FIR checker: Create a new kind of checker FirTypeChecker and add

FirSuspendModifierChecker to report WRONG_MODIFIER_TARGET for `suspend`
on  non-functional types.
This commit is contained in:
Mark Punzalan
2021-04-21 16:23:43 +03:00
committed by TeamCityServer
parent 4282d17467
commit e69b729e21
19 changed files with 254 additions and 62 deletions
@@ -22,7 +22,8 @@ typealias Test15 = (@A() suspend () -> Unit)?
typealias Test16 = (@A suspend () -> Unit)?
typealias Test17 = @A suspend RS.() -> Unit
typealias Test18 = (suspend () -> Unit)?
typealias Test19 = (@A({ val x: <!WRONG_MODIFIER_TARGET!>suspend<!> String? = null; "" }()) suspend () -> Unit)?
typealias Test19 = (@A({ val x: <!WRONG_MODIFIER_TARGET, WRONG_MODIFIER_TARGET!>suspend<!> String? = null; "" }()) suspend () -> Unit)?
typealias Test20 = (@A("".let { val x: <!WRONG_MODIFIER_TARGET, WRONG_MODIFIER_TARGET!>suspend<!> String? = null; it }) suspend () -> Unit)?
interface Supertype1 : suspend () -> Unit {
@@ -23,6 +23,7 @@ typealias Test16 = (@A suspend () -> Unit)?
typealias Test17 = @A suspend RS.() -> Unit
typealias Test18 = (suspend () -> Unit)?
typealias Test19 = (@A(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>{ val x: <!WRONG_MODIFIER_TARGET, WRONG_MODIFIER_TARGET!>suspend<!> String? = null; "" }()<!>) suspend () -> Unit)?
typealias Test20 = (@A(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"".let { val x: <!WRONG_MODIFIER_TARGET, WRONG_MODIFIER_TARGET!>suspend<!> String? = null; it }<!>) suspend () -> Unit)?
interface Supertype1 : <!SUPERTYPE_IS_SUSPEND_FUNCTION_TYPE!>suspend () -> Unit<!> {
@@ -47,6 +47,7 @@ public typealias Test17 = (@A suspend RS.() -> kotlin.Unit)
public typealias Test18 = (suspend () -> kotlin.Unit)?
public typealias Test19 = (@A suspend () -> kotlin.Unit)?
public typealias Test2 = suspend kotlin.Int.() -> kotlin.Unit
public typealias Test20 = (@A suspend () -> kotlin.Unit)?
public typealias Test3 = () -> kotlin.Unit
public typealias Test4 = Action
public typealias Test5 = kotlin.collections.List<suspend () -> kotlin.Unit>