KT-41 Make functions with errors in returning statement return ERROR type and not Nothing
This commit is contained in:
+3
@@ -188,6 +188,9 @@ public class ExpressionTypingServices {
|
||||
trace.record(STATEMENT, returnedExpression, false);
|
||||
if (cachedType != null) {
|
||||
typeMap.put(returnedExpression, cachedType);
|
||||
}
|
||||
else {
|
||||
typeMap.put(returnedExpression, ErrorUtils.createErrorType("Error function type"));
|
||||
}
|
||||
}
|
||||
return typeMap;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// KT-41 Make functions with errors in returning statement return ERROR type and not Nothing
|
||||
|
||||
namespace kt41
|
||||
|
||||
fun aaa() =
|
||||
6 <!UNRESOLVED_REFERENCE!>foo<!> 1
|
||||
|
||||
fun bbb() {
|
||||
aaa()
|
||||
1 // Stupid error: unreachable code
|
||||
}
|
||||
Reference in New Issue
Block a user