KT-1436 Nicer compiler errors when the feature isn't supported
This commit is contained in:
committed by
teamcity
parent
e6900ec0f2
commit
1215ae0fe7
@@ -938,7 +938,13 @@ class ControlFlowProcessor(
|
||||
// See generateInitializersForClassOrObject && generateDeclarationForLocalClassOrObjectIfNeeded
|
||||
labelExprEnclosingFunc is ConstructorDescriptor && !labelExprEnclosingFunc.isPrimary
|
||||
) {
|
||||
trace.report(BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY.on(jumpExpression))
|
||||
val dependsOnInlineLambdas = !skipInlineFunctions &&
|
||||
getEnclosingFunctionDescriptor(bindingContext, jumpExpression, true) == getEnclosingFunctionDescriptor(bindingContext, jumpTarget, true)
|
||||
if (dependsOnInlineLambdas) {
|
||||
trace.report(UNSUPPORTED_FEATURE.on(jumpExpression, BreakContinueInInlineLambdas to languageVersionSettings))
|
||||
} else {
|
||||
trace.report(BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY.on(jumpExpression))
|
||||
}
|
||||
}
|
||||
false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user