October 05, 2011 [Issue 6769] New: [CTFE] AA.keys doesn't compile when -inline is used | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6769 Summary: [CTFE] AA.keys doesn't compile when -inline is used Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: clugdbug@yahoo.com.au --- Comment #0 from Don <clugdbug@yahoo.com.au> 2011-10-05 01:39:45 PDT --- This is an extremely ugly issue which broke the autotester. The problem is the templated AA inside object.di. It performs some nasty casts to void[], then calls the runtime. To avoid this, the CTFE engine intercepts all AA built-in functions at a higher level. But, the inliner really fouls things up, because it optimizes away the functions which the CTFE engine tries to recognize. Minimal test case for 2.055 static assert({ int[int] w= [1:2]; return w.keys.length; }()==1); This works OK, as long as -inline isn't used. But with -inline, it gives: c:\dmd\windows\bin\..\..\src\druntime\import\object.di(378): Error: _aaKeys cann ot be interpreted at compile time, because it has no available source code test.d(6): Error: cannot evaluate delegate @system uint() { int[int] w = [1:2]; return (ref AssociativeArray!(int,int) this = w; , (assert(&this,"null this") , (void[] a = _aaKeys(this.p,4u); , *& a))).length; } () at compile time ------- Note that the member variable 'p' is void *. The whole thing is a disgusting cast-fest. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 06, 2011 [Issue 6769] [CTFE] AA.keys doesn't compile when -inline is used | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don | http://d.puremagic.com/issues/show_bug.cgi?id=6769 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2011-10-05 20:39:02 PDT --- https://github.com/D-Programming-Language/dmd/commit/85af04b5f02277ae8ae49b3a7d11ce20180ce5cd https://github.com/D-Programming-Language/dmd/commit/7c11df2d3529bd3fd6c6dc5682aedd1ba08ecbe8 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation