Thread overview | |||||
---|---|---|---|---|---|
|
November 18, 2011 [dmd-internals] CTFE regression in Git master (bf25caa) | ||||
---|---|---|---|---|
| ||||
Some of the changes since the last release caused a regression in CTFE: --- import std.conv; enum short a = 1000; enum b = to!string(a); --- now fails with: --- CTFE internal error: unsupported assignment cast(uint)cast(int)n /= base Assertion failed: (e1->op == TOKarraylength || e1->op == TOKvar || e1->op == TOKdotvar || e1->op == TOKindex || e1->op == TOKslice), function interpretAssignCommon, file interpret.c, line 3343. --- As it probably clear to you what's happening here anyway, Don, I didn't reduce it any further so far. This is the corresponding source line: https://github.com/D-Programming-Language/phobos/blob/master/std/format.d#L1105 David |
November 18, 2011 [dmd-internals] CTFE regression in Git master (bf25caa) | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | On 18 November 2011 18:35, David Nadlinger <code at klickverbot.at> wrote: > Some of the changes since the last release caused a regression in CTFE: > --- > import std.conv; > enum short a = 1000; > enum b = to!string(a); > --- > now fails with: > --- > CTFE internal error: unsupported assignment cast(uint)cast(int)n /= base > Assertion failed: (e1->op == TOKarraylength || e1->op == TOKvar || e1->op == > TOKdotvar || e1->op == TOKindex || e1->op == TOKslice), function > interpretAssignCommon, file interpret.c, line 3343. > --- > > As it probably clear to you what's happening here anyway, Don, I didn't > reduce it any further so far. This is the corresponding source line: > https://github.com/D-Programming-Language/phobos/blob/master/std/format.d#L1105 Reduced test case. This has never worked in CTFE, so it's a change to Phobos that exposed it. The fix is simple. int regress() { ubyte n = 6; n /= 2u; return n; } static assert(regress()==3); > > David > _______________________________________________ > dmd-internals mailing list > dmd-internals at puremagic.com > http://lists.puremagic.com/mailman/listinfo/dmd-internals > |
November 18, 2011 [dmd-internals] CTFE regression in Git master (bf25caa) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | On 11/18/11 8:59 PM, Don Clugston wrote:
> This has never worked in CTFE, so it's a change to
> Phobos that exposed it. The fix is simple.
Oh, you are right, sorry ? I forgot that value formatting was unified since DMD 2.056. In any case, thanks a lot for the quick fix!
David
|
Copyright © 1999-2021 by the D Language Foundation