[Issue 15309] [dmd-internal] ScopeExp.semantic() should set its type always

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 25 03:09:21 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15309

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu

--- Comment #5 from Martin Nowak <code at dawg.eu> ---
I don't agree w/ this change, my comment from
https://github.com/D-Programming-Language/dmd/pull/5263/files#r50680394.

+                // ti is an instance which requires IFTI.
+                sds = ti;
+                type = Type.tvoid;

This in particular changed the semantic of typeof(func!arg) from Error:
expression (func!arg) has no type to plain void. I think it's incorrect to type
a not fully instantiated template function as void (even though there is some
precedence w/ templates being of type void).
For non-function templates it's an error when arguments are missing and even
with this change typeof(&func!arg) triggers the same error.
On top of this all this change broken is(typeof(T.someAttribute)) detection for
types w/ opDispatch.

Also see issue 15550 which was introduced by this change.

--


More information about the Digitalmars-d-bugs mailing list