[Issue 9828] Inconsistent lowering of 1-element tuple to its element

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 23 18:39:53 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9828



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2013-07-23 18:39:52 PDT ---
(In reply to comment #0)
>     alias tuple!("foo") Foo;
>     alias d = get!Foo;  // works, ??

Here's no inconsistency. If you give a tuple as template argument, it would be
automatically expanded to its elements.
And if the tuple contains just one symbol element, the template argument would
match to alias version.

>     if (d == "foo") { }  // works
>     if (Foo == "foo") { }  // does not work

OTOH, currently one-element tuple is not automatically expanded to the element
itself on the each side of binary operator.
I'm not sure this is well designed, but I think that holding the distinction of
them would be valuable than mixing them.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list