D-Programming-Language/dmd — pull request #1177 by yebblies (2012-10-11 17:33:10+00:00)
Title: Issue 1353 - Can't use typeof() in base class list.

Remove the restriction that a base class must being with an identifier (or a dot) and accept any type during passing. The semantic checks give better error messages anyway.

(From Pull #1175)

While it will let really stupid base class choices pass to semantic, the error messages in those cases will improve signifigantly:
`class A : int {}`
results in:
```
test.d(2): Error: base classes expected instead of int
test.d(2): Error: members expected
test.d(2): Error: { } expected following aggregate declaration
test.d(2): Error: no identifier for declarator int
test.d(2): Error: semicolon expected, not '{'
test.d(2): Error: Declaration expected, not '{'
```

while
```
alias int Int;
class A : Int {}
```
results in:
`test.d(3): Error: class test.A base type must be class or interface, not int`

The downside is that some really silly types will not be rejected if the code doesn't go through semantic, such as code in templates that are not instantiated or code that is versioned out. This is nothing new and applies to the vast majority of bugs. The type used has to be _really_ silly, `int` currently fails at parse time while an alias to `int` makes it through to semantic.

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