On 10/07/14 22:47, "Marc Schütz" <schue...@gmx.net>" wrote:

No, this is equivalent to:

void bar (string a)
{
     assert(a is "GET");
}

void asd()
{
     bar("GET");
}

Enums behave as if their values are copy-n-pasted everywhere they are
used (you probably know that).

Yes, I was thinking that. Then I was thinking string literals are put directly in the executable and then I got confused about it behaving differently in out in a separate module.

The compiler probably conflates the two identical strings when they're
in the same module. This is safe for immutable data. I'm sure there's
something in the spec about it...

Sounds reasonable.

--
/Jacob Carlborg

Reply via email to