ceylon/ceylon-spec — Issue #63: ClassCastException in TypeVisitor upon return type set twice in a method
Author: emmanuelbernard
Created: 2011-11-22 16:48:39+00:00
State: open

```
shared void starter() {
String emmanuel = "emmanuel";
print("hello " emmanuel "");
}

shared void String hello() {
return "hello";
}
```

The `void` before `String` in `hello()` leads to many type checker issues and `ClassCastException`s in `TypeVisitor`.

error encountered [TypeVisitor caused an exception visiting BaseType node: java.lang.ClassCastException:
com.redhat.ceylon.compiler.typechecker.model.Method cannot be cast to
com.redhat.ceylon.compiler.typechecker.model.TypeDeclaration at
com.redhat.ceylon.compiler.typechecker.analyzer.Util.getBaseDeclaration(Util.java:31)] at 4:15-4:20 of Assignability.ceylon