digitalmars.D.learn - Assertion failure: 'fieldi>=0 && fieldi < se->elements->dim' on line 2062 in file 'interpret.c'
- strtr (1/1) May 07 2010 Killed it again :(
- strtr (3/3) May 07 2010 Not feeding a float to ToString! seems to bring it back to life.
- Don (3/5) May 07 2010 Are you using the latest DMD? If so, please try to create a test case,
- strtr (30/36) May 13 2010 Had to put some time into actual coding..
- bearophile (11/11) May 13 2010 This produces the same errors:
Not feeding a float to ToString! seems to bring it back to life. What is up with that anyway? How do I output a float in compile time?
May 07 2010
strtr wrote:Killed it again :(Are you using the latest DMD? If so, please try to create a test case, as this bug has never been reported before. Thanks!
May 07 2010
Don Wrote:strtr wrote:I was/am using 1.060Killed it again :(Are you using the latest DMD?If so, please try to create a test case, as this bug has never been reported before. Thanks!Had to put some time into actual coding.. but I just tried to create a test case: Removed the few dependencies of the fixed problem module and tried to compile it by importing it in a clean main module. It didn't compile, which led me to this tiny version which still doesn't compile : ---- module main; import s_def; void main(){} ---- module s_def; struct S { float area; static S opCall( float a_ ) { S s = { a_ }; return s; } const S _s = S( 1f ); } ---- s_def.d(3): Error: struct s_def.S no size yet for forward reference I don't know what this means s_def.d(12): Error: cannot evaluate opCall(1F) at compile time Probably related. As far as I know I do exactly the same in my program After understanding this I'll try to recreate the ToString!() bug :)
May 13 2010
This produces the same errors: struct Foo { int bar; static Foo baz() { return Foo(); } const Foo one = Foo.baz(); } void main() {} Bye, bearophile
May 13 2010
== Quote from bearophile (bearophileHUGS lycos.com)'s articleThis produces the same errors: struct Foo { int bar; static Foo baz() { return Foo(); } const Foo one = Foo.baz(); } void main() {} Bye, bearophileAnd this is why in my program compiled anyways : ---- module main; import s_def; void main(){} ---- module s_def; import e_def; // <---this struct S { float area; static S opCall( float a_ ) { S s = { a_ }; return s; } const S _s = S( 1f ); } ---- module e_def; import s_def; const S e = S(1f); ---- I have import problems quite regularly, but I always fail at tinifying them :)
May 14 2010
or : module main; //const S s = S(.5f); // Uncomment to make it compile struct S { float a; static S opCall( float a_ ) { S s = { a_ }; return s; } const S _s = S( 1f ); } void main(){}
May 14 2010