FIR checker: honor DSL marker annotation on the function type
It seems the original function type gets lost during resolution. Hence thie change added a custom attribute to recover the original function type on an anonymous function
This commit is contained in:
committed by
TeamCityServer
parent
826ea122a9
commit
c572bf05b5
@@ -103,4 +103,23 @@ var <D : FirCallableDeclaration>
|
||||
D.originalForIntersectionOverrideAttr: D? by FirDeclarationDataRegistry.data(IntersectionOverrideOriginalKey)
|
||||
|
||||
private object InitialSignatureKey : FirDeclarationDataKey()
|
||||
|
||||
var FirCallableDeclaration.initialSignatureAttr: FirCallableDeclaration? by FirDeclarationDataRegistry.data(InitialSignatureKey)
|
||||
|
||||
private object MatchingParameterFunctionTypeKey : FirDeclarationDataKey()
|
||||
|
||||
/**
|
||||
* Consider the following
|
||||
* ```
|
||||
* fun <T> run(block: @Foo T.() -> Unit) {...}
|
||||
*
|
||||
* fun test() {
|
||||
* run<String> {
|
||||
* <caret>
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* The original function type `@Foo T.() -> Unit` can be accessed with this property on the FirAnonymousFunction at caret.
|
||||
*/
|
||||
var <D : FirAnonymousFunction>
|
||||
D.matchingParameterFunctionType: ConeKotlinType? by FirDeclarationDataRegistry.data(MatchingParameterFunctionTypeKey)
|
||||
|
||||
Reference in New Issue
Block a user