digitalmars.D.learn - incomprehensible return error bug?
- strtr <strtr spam.com> Jan 24 2010
- strtr <strtr spam.com> Jan 24 2010
- strtr <strtr spam.com> Jan 24 2010
- g <g g.g> Jan 24 2010
- g <g g.g> Jan 24 2010
- strtr <strtr spam.com> Jan 25 2010
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?
Jan 24 2010
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 :(
Jan 24 2010
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.
Jan 24 2010
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
Jan 24 2010
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
Jan 24 2010
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.
Jan 25 2010








strtr <strtr spam.com>