diff --git a/base/src/main/java/org/arend/typechecking/visitor/DefinitionTypechecker.java b/base/src/main/java/org/arend/typechecking/visitor/DefinitionTypechecker.java index 95029b57a..3869d278f 100644 --- a/base/src/main/java/org/arend/typechecking/visitor/DefinitionTypechecker.java +++ b/base/src/main/java/org/arend/typechecking/visitor/DefinitionTypechecker.java @@ -1950,7 +1950,7 @@ private List typecheckFunctionBody(FunctionDefinition typedDef, C } index++; } - } else { + } else if (!expectedType.isError()) { errorReporter.report(new CertainTypecheckingError(CertainTypecheckingError.Kind.INSTANCE_TYPE, def)); } } else if (kind == FunctionKind.TYPE) {