Classified usages in "is" of when entry correctly.
#KT-7047 fixed
This commit is contained in:
@@ -103,7 +103,8 @@ public object UsageTypeUtils {
|
|||||||
refExpr.getParentOfTypeAndBranch<JetParameter>(){ getTypeReference() } != null ->
|
refExpr.getParentOfTypeAndBranch<JetParameter>(){ getTypeReference() } != null ->
|
||||||
VALUE_PARAMETER_TYPE
|
VALUE_PARAMETER_TYPE
|
||||||
|
|
||||||
refExpr.getParentOfTypeAndBranch<JetIsExpression>(){ getTypeReference() } != null ->
|
refExpr.getParentOfTypeAndBranch<JetIsExpression>(){ getTypeReference() } != null
|
||||||
|
|| refExpr.getParentOfTypeAndBranch<JetWhenConditionIsPattern>(){ getTypeReference() } != null ->
|
||||||
IS
|
IS
|
||||||
|
|
||||||
with(refExpr.getParentOfTypeAndBranch<JetBinaryExpressionWithTypeRHS>(){ getRight() }) {
|
with(refExpr.getParentOfTypeAndBranch<JetBinaryExpressionWithTypeRHS>(){ getRight() }) {
|
||||||
|
|||||||
@@ -38,5 +38,8 @@ fun Client.hasNextServer(): Boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Any.asServer(): Server? {
|
fun Any.asServer(): Server? {
|
||||||
|
when (this) {
|
||||||
|
is Server -> println("Server!")
|
||||||
|
}
|
||||||
return if (this is Server) this as Server else null
|
return if (this is Server) this as Server else null
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ Super type qualifier (19: 15) super<Server>.work()
|
|||||||
Supertype (23: 23) companion object: Server() {
|
Supertype (23: 23) companion object: Server() {
|
||||||
Supertype (28: 22) object ClientObject: Server() {
|
Supertype (28: 22) object ClientObject: Server() {
|
||||||
Supertype (5: 43) class Client(name: String = Server.NAME): Server() {
|
Supertype (5: 43) class Client(name: String = Server.NAME): Server() {
|
||||||
Target type of 'is' operation (41: 24) return if (this is Server) this as Server else null
|
Target type of 'is' operation (42: 12) is Server -> println("Server!")
|
||||||
Usage in cast target type (41: 40) return if (this is Server) this as Server else null
|
Target type of 'is' operation (44: 24) return if (this is Server) this as Server else null
|
||||||
|
Usage in cast target type (44: 40) return if (this is Server) this as Server else null
|
||||||
Usage in import (3: 15) import server.Server
|
Usage in import (3: 15) import server.Server
|
||||||
|
|||||||
Reference in New Issue
Block a user