[FIR] Prohibit referencing type parameters in contracts ...
...if they are not reified or not belong to owner declaration of the contract KT-57911
This commit is contained in:
committed by
Space Team
parent
5a92eb2c67
commit
f8dc8057f0
Vendored
+4
-4
@@ -12,9 +12,9 @@ inline fun <reified T> referToReifiedGeneric(x: Any?) {
|
||||
|
||||
class Generic<T> {
|
||||
fun referToCaptured(x: Any?) {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
returns() implies (x is T)
|
||||
}<!>
|
||||
contract {
|
||||
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns() implies (x is T)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,4 @@ fun referToAliasedSimpleType(x: Any?) {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
returns() implies (x is SimpleType)
|
||||
}<!>
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -12,9 +12,9 @@ inline fun <reified T> referToReifiedGeneric(x: Any?) {
|
||||
|
||||
class Generic<T> {
|
||||
fun referToCaptured(x: Any?) {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
returns() implies (x is T)
|
||||
}<!>
|
||||
contract {
|
||||
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns() implies (x is T)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,4 @@ fun referToAliasedSimpleType(x: Any?) {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
returns() implies (x is SimpleType)
|
||||
}<!>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user