Basic resolve for 'throw'

This commit is contained in:
Andrey Breslav
2011-04-25 13:09:03 +04:00
parent 968e22f999
commit 6a178a4940
2 changed files with 6 additions and 1 deletions
@@ -157,7 +157,7 @@ public class BindingTraceContext implements BindingContext, BindingTrace {
} }
@Override @Override
public PsiElement getDeclarationPsiElement(DeclarationDescriptor descriptor) { public PsiElement getDeclarationPsiElement(@NotNull DeclarationDescriptor descriptor) {
return descriptorToDeclarations.get(descriptor.getOriginal()); return descriptorToDeclarations.get(descriptor.getOriginal());
} }
@@ -759,6 +759,11 @@ public class JetTypeInferrer {
@Override @Override
public void visitThrowExpression(JetThrowExpression expression) { public void visitThrowExpression(JetThrowExpression expression) {
JetExpression thrownExpression = expression.getThrownExpression();
if (thrownExpression != null) {
JetType type = getType(scope, thrownExpression, false);
// TODO : check that it inherits Throwable
}
result = JetStandardClasses.getNothingType(); result = JetStandardClasses.getNothingType();
} }