No __ as lambda parameter
This commit is contained in:
+5
-5
@@ -27,11 +27,8 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticUtils
|
||||
import org.jetbrains.kotlin.diagnostics.Errors.*
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getAnnotationEntries
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.*
|
||||
import org.jetbrains.kotlin.resolve.BindingContext.EXPECTED_RETURN_TYPE
|
||||
import org.jetbrains.kotlin.resolve.BindingContextUtils
|
||||
import org.jetbrains.kotlin.resolve.BindingTrace
|
||||
import org.jetbrains.kotlin.resolve.FunctionDescriptorUtil
|
||||
import org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalWritableScope
|
||||
import org.jetbrains.kotlin.resolve.source.toSourceElement
|
||||
@@ -141,7 +138,10 @@ public class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Express
|
||||
val functionTypeExpected = !noExpectedType(expectedType) && KotlinBuiltIns.isFunctionOrExtensionFunctionType(expectedType)
|
||||
|
||||
val functionDescriptor = createFunctionLiteralDescriptor(expression, context)
|
||||
expression.valueParameters.forEach { components.identifierChecker.checkDeclaration(it, context.trace) }
|
||||
expression.valueParameters.forEach {
|
||||
components.identifierChecker.checkDeclaration(it, context.trace)
|
||||
UnderscoreChecker.checkNamed(it, context.trace)
|
||||
}
|
||||
val safeReturnType = computeReturnType(expression, context, functionDescriptor, functionTypeExpected)
|
||||
functionDescriptor.setReturnType(safeReturnType)
|
||||
|
||||
|
||||
@@ -14,3 +14,7 @@ fun <!UNDERSCORE_IS_DEPRECATED!>__<!>(<!UNDERSCORE_IS_DEPRECATED!>___<!>: Int, y
|
||||
val `_` = __________
|
||||
<!UNDERSCORE_IS_DEPRECATED!>__<!>@ return if (y != null) __(____, y) else __(`_`, ______)
|
||||
}
|
||||
|
||||
fun doIt(f: (Any?) -> Any?) = f(null)
|
||||
|
||||
val something = doIt { <!UNDERSCORE_IS_DEPRECATED!>__<!> -> __ }
|
||||
@@ -1,7 +1,9 @@
|
||||
package
|
||||
|
||||
public val ______: _<kotlin.Int>
|
||||
public val something: kotlin.Any?
|
||||
public fun __(/*0*/ ___: kotlin.Int, /*1*/ y: _<kotlin.Int>?): kotlin.Int
|
||||
public fun doIt(/*0*/ f: (kotlin.Any?) -> kotlin.Any?): kotlin.Any?
|
||||
|
||||
@kotlin.Deprecated(message = "") @kotlin.data() public final class Pair {
|
||||
public constructor Pair(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int)
|
||||
|
||||
Reference in New Issue
Block a user