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



--- Comment #1 from Kenji Hara <k.hara...@gmail.com> 2012-02-19 15:25:42 PST ---
I think typeof(overloadset):=void is not good.
Because, in this case, calculating typeof(foo) to void is valid by translating
foo to foo() first.

So introducing new ambiguous function type instead of void is much better.
(My idea is here: https://github.com/D-Programming-Language/dmd/pull/71)

void foo();
void foo(int);
static assert(is(typeof(foo) == void));  // without -property switch
static if (is(typeof(foo) R)) {} // evaluated to false with -property switch,
                                 // because R is ambiguous type, not exact
type.
@property int foo();
@property void foo(int);
static assert(is(typeof(foo) == int));  // always true

void foo(int);
void foo(long);
static assert(is(typeof(foo)));  // always true, because foo has some type,
                                 // even if it is ambiguous type.
static if (is(typeof(foo) R)) {} // evaluated to false, 
                                 // because R is ambiguous type, not exact
type.

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

Reply via email to