Thread overview |
---|
January 24, 2010 incomprehensible return error bug? | ||||
---|---|---|---|---|
| ||||
enum { A = 0, B, C } void func(){ return A; } void main() { } main.d(1): Error: long has no effect in expression (0) Is this a bug? |
January 24, 2010 Re: incomprehensible return error bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to strtr | strtr Wrote:
> enum { A = 0, B, C }
>
> void func(){ return A; }
>
> void main()
> {
> }
>
> main.d(1): Error: long has no effect in expression (0)
>
> Is this a bug?
This error also points to the enum which is probably incorrectly used somewhere
s_def(32) Error: cannot implicitly convert expression (5) of type int to S
Still searching for the original bug btw :(
|
January 25, 2010 Re: incomprehensible return error bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to strtr | strtr Wrote:
> This error also points to the enum which is probably incorrectly used somewhere
> s_def(32) Error: cannot implicitly convert expression (5) of type int to S
>
> Still searching for the original bug btw :(
Found it, also a return type mismatch problem; returning a enum member where the encapsulating struct should have been returned.
|
January 25, 2010 Re: incomprehensible return error bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to strtr | strtr Wrote:
> strtr Wrote:
>
> > This error also points to the enum which is probably incorrectly used somewhere
> > s_def(32) Error: cannot implicitly convert expression (5) of type int to S
> >
> > Still searching for the original bug btw :(
>
> Found it, also a return type mismatch problem; returning a enum member where the encapsulating struct should have been returned.
BTW, the function says void ( no return ) and you try tu return an integer ( form a enum )
yea, is incomprehensible but is not wrong
|
January 25, 2010 Re: incomprehensible return error bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to g | g Wrote:
> strtr Wrote:
>
> > strtr Wrote:
> >
> > > This error also points to the enum which is probably incorrectly used somewhere
> > > s_def(32) Error: cannot implicitly convert expression (5) of type int to S
> > >
> > > Still searching for the original bug btw :(
> >
> > Found it, also a return type mismatch problem; returning a enum member where the encapsulating struct should have been returned.
>
also , why in the world would you try to convert a manifest constant into a struct
|
January 25, 2010 Re: incomprehensible return error bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to g | g Wrote:
> g Wrote:
>
> > strtr Wrote:
> >
> > > strtr Wrote:
> > >
> > > > This error also points to the enum which is probably incorrectly used somewhere
> > > > s_def(32) Error: cannot implicitly convert expression (5) of type int to S
> > > >
> > > > Still searching for the original bug btw :(
> > >
> > > Found it, also a return type mismatch problem; returning a enum member where the encapsulating struct should have been returned.
> >
>
> also , why in the world would you try to convert a manifest constant into a struct
Oh, you misunderstand (I was probably not clear enough :)
I know the bugs in my program were mine, but I think that the incomprehensibility of the error is a bug in dmd.
They should point of type mismatch location, not to the enum line.
|
Copyright © 1999-2021 by the D Language Foundation