Bug 2869 – alias type not equal to origin type when typeof called on it

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-21T07:28:00Z
Last change time
2015-06-09T01:27:44Z
Assigned to
bugzilla
Creator
galaxylang

Comments

Comment #0 by galaxylang — 2009-04-21T07:28:08Z
alias type not equel to origin type when typeof call on it only occur on the basic type such as: alias int inttype; if(is(typeof(int)) //complier error if(is(typeof(inttype))//OK
Comment #1 by smjg — 2009-04-27T03:59:37Z
The compiler is behaving correctly. http://www.digitalmars.com/d/2.0/declaration.html#Typeof Typeof: typeof ( Expression ) typeof ( return ) "int" is not parseable as an expression, therefore "typeof(int)" correctly fails to compile. "inttype" is, OTOH, parseable as an expression, just not semantically valid as one. Therefore the IsExpression correctly evaluates to false.