[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Strange message error

From: Stephen Compall
Subject: Re: [DotGNU]Strange message error
Date: 23 Oct 2003 20:16:53 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"brunoacf" <address@hidden> writes:

>     public SomeFunction ( ) {       //
> ERROR: Function must have a value type
> sample.cs:7: constructor name does not
> match class name
> sample.cs:9: declaration of `.ctor'
> conflicts with an existing member
> The compiler thinks that SomeFunction() is a constructor because it
> don't have a return type.

The given "function without a return type" syntatically looks like a
constructor.  Consider the case in which the programmer has merely
misspelled the ctor name, with the intention still being to create a
constructor.  The compiler can't tell the difference between "function
without a return type" and "misspelled named constructor", unless the
"return" keyword is used in the body, and even this is not reliable,
not to mention silly.

Stephen Compall or s11 or sirian

Patience is the best remedy for every trouble.
                -- Titus Maccius Plautus

22nd SAS Kh-11 propaganda FSF arrangements InfoSec ASO Blowfish Area
51 Marxist Waco, Texas csystems Baranyi World Trade Center Forte

reply via email to

[Prev in Thread] Current Thread [Next in Thread]