Thread overview |
---|
November 27, 2010 Internal error: e2ir.c 4629 | ||||
---|---|---|---|---|
| ||||
Hello, I get the above error when compiling. No idea what it means. It happens when I add the following func: enum XHTML_CODES = ["&":"&", "<":"<", ">":">", "\"":""", "'":"'"]; string xhtmlEscape (in string text) { string newText = text; foreach (string ch, string code ; XHTML_CODES) newText = replace(newText, ch, code); return newText; } (Note: writing codes as raw strings does not help.) Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com |
November 27, 2010 Re: Internal error: e2ir.c 4629 | ||||
---|---|---|---|---|
| ||||
Posted in reply to spir | If this isn't in bugzilla, please file a bug report. http://d.puremagic.com/issues/query.cgi |
November 27, 2010 Re: Internal error: e2ir.c 4629 | ||||
---|---|---|---|---|
| ||||
Posted in reply to spir | On 27/11/2010 16:16, spir wrote: > Hello, > > I get the above error when compiling. No idea what it means. > It happens when I add the following func: > > enum XHTML_CODES = ["&":"&", "<":"<", ">":">", "\"":""", "'":"'"]; > > string xhtmlEscape (in string text) { > string newText = text; > foreach (string ch, string code ; XHTML_CODES) > newText = replace(newText, ch, code); > return newText; > } > > (Note: writing codes as raw strings does not help.) > > Denis > -- -- -- -- -- -- -- > vit esse estrany ☣ > > spir.wikidot.com > The compiler expects AA literals to be mutable and you've made it immutable by sticking it in an enum. -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.uk |
November 27, 2010 Re: Internal error: e2ir.c 4629 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | Trass3r wrote:
> If this isn't in bugzilla, please file a bug report.
> http://d.puremagic.com/issues/query.cgi
It probably has the same root cause as bug 4066.
|
November 27, 2010 Re: Internal error: e2ir.c 4629 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Simon | On Sat, 27 Nov 2010 18:40:34 +0000
Simon <s.d.hammett@gmail.com> wrote:
> On 27/11/2010 16:16, spir wrote:
> > Hello,
> >
> > I get the above error when compiling. No idea what it means. It happens when I add the following func:
> >
> > enum XHTML_CODES = ["&":"&", "<":"<", ">":">", "\"":""", "'":"'"];
> >
> > string xhtmlEscape (in string text) {
> > string newText = text;
> > foreach (string ch, string code ; XHTML_CODES)
> > newText = replace(newText, ch, code);
> > return newText;
> > }
> >
> > (Note: writing codes as raw strings does not help.)
> >
> > Denis
> > -- -- -- -- -- -- --
> > vit esse estrany ☣
> >
> > spir.wikidot.com
> >
>
> The compiler expects AA literals to be mutable and you've made it immutable by sticking it in an enum.
>
The bug has something to do with that, but it'd not exactly that. The enum itself is OK. It's when adding the func that "Internal error: e2ir.c 4629" is emiited at compile-time.
But you are right anyway, as the following compiles finely:
string xhtmlEscape (in string text) {
auto XHTML_CODES = ["&":"&", "<":"<", ">":">", "\"":""", "'":"'"];
string newText = text;
foreach (string ch, string code ; XHTML_CODES)
newText = replace(newText, ch, code);
return newText;
}
I had put the enum outside the func, because the compiler does not (yet) accept static AAs. But obviously, that does not solve the issue... I'll file a bug tomorrow if the issue mentionned in another reply seems different (tonight is tool late).
Denis
-- -- -- -- -- -- --
vit esse estrany ☣
spir.wikidot.com
|
Copyright © 1999-2021 by the D Language Foundation