[K2] Disappeared OPT_IN_USAGE_ERROR for typealias
^KT-62451
This commit is contained in:
committed by
Space Team
parent
54285736d0
commit
6d446abe12
+3
-1
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.fir.references.resolved
|
|||||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||||
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
|
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
|
||||||
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.scopes.impl.typeAliasForConstructor
|
||||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
|
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||||
@@ -191,8 +192,9 @@ object FirOptInUsageBaseChecker {
|
|||||||
) {
|
) {
|
||||||
val parentClassSymbol = containingClassLookupTag()?.toSymbol(context.session) as? FirRegularClassSymbol
|
val parentClassSymbol = containingClassLookupTag()?.toSymbol(context.session) as? FirRegularClassSymbol
|
||||||
if (this is FirConstructor) {
|
if (this is FirConstructor) {
|
||||||
|
val ownerClassLikeSymbol = this.typeAliasForConstructor ?: parentClassSymbol
|
||||||
// For other callable we check dispatch receiver type instead
|
// For other callable we check dispatch receiver type instead
|
||||||
parentClassSymbol?.loadExperimentalities(
|
ownerClassLikeSymbol?.loadExperimentalities(
|
||||||
context, result, visited, fromSetter = false, dispatchReceiverType = null, fromSupertype = false
|
context, result, visited, fromSetter = false, dispatchReceiverType = null, fromSupertype = false
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+3
-3
@@ -69,9 +69,9 @@ typealias YourList = ArrayList<String>
|
|||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
val x = <!OPT_IN_USAGE_ERROR!>listOf<!>(A(), B())
|
val x = <!OPT_IN_USAGE_ERROR!>listOf<!>(A(), B())
|
||||||
val y = MyList()
|
val y = <!OPT_IN_USAGE_ERROR!>MyList<!>()
|
||||||
val z = YourList()
|
val z = <!OPT_IN_USAGE_ERROR!>YourList<!>()
|
||||||
YourList().add("")
|
<!OPT_IN_USAGE_ERROR!>YourList<!>().add("")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Marker
|
@Marker
|
||||||
|
|||||||
+3
-3
@@ -69,9 +69,9 @@ typealias YourList = ArrayList<String>
|
|||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
val x = <!OPT_IN_USAGE_ERROR!>listOf<!>(A(), B())
|
val x = <!OPT_IN_USAGE_ERROR!>listOf<!>(A(), B())
|
||||||
val y = MyList()
|
val y = <!OPT_IN_USAGE_ERROR!>MyList<!>()
|
||||||
val z = YourList()
|
val z = <!OPT_IN_USAGE_ERROR!>YourList<!>()
|
||||||
YourList().add("")
|
<!OPT_IN_USAGE_ERROR!>YourList<!>().add("")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Marker
|
@Marker
|
||||||
|
|||||||
Reference in New Issue
Block a user