ceylon/ceylon-spec — Issue #94: Exceptions in typechecker
Author: FroMage
Created: 2011-12-08 14:02:22+00:00
State: open

While working on better error recovery from the compiler I occasionally encounter exceptions in the typechecker, should I report them all?

```java
MissingType brokenMethod() given S satisfies MissingType {
}
```

```
(ERROR) BrokenMethod.ceylon[1,31]: no matching type parameter for constraint: S
(ERROR) BrokenMethod.ceylon[1,31]: DeclarationVisitor caused an exception visiting TypeConstraint node: java.lang.NullPointerException at com.redhat.ceylon.compiler.typechecker.analyzer.DeclarationVisitor.visit(DeclarationVisitor.java:229)
(ERROR) BrokenMethod.ceylon[1,39]: TypeVisitor caused an exception visiting SatisfiedTypes 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.TypeVisitor.visit(TypeVisitor.java:494)
(ERROR) BrokenMethod.ceylon[1,39]: ExpressionVisitor caused an exception visiting SatisfiedTypes 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.ExpressionVisitor.visit(ExpressionVisitor.java:2649)
(ERROR) BrokenMethod.ceylon[1,49]: type declaration not found: MissingType
(ERROR) BrokenMethod.ceylon[1,1]: returned expression must be assignable to return type of brokenMethod: type of expression cannot be determined
(ERROR) BrokenMethod.ceylon[1,1]: type does not exist: MissingType
(ERROR) BrokenMethod.ceylon[1,1]: type declaration not found: MissingType
```