JS/RTTI: fix nullability check
This commit is contained in:
committed by
Alexey Andreev
parent
7a5b4650ad
commit
87659bd95b
+2
-2
@@ -105,7 +105,7 @@ public final class PatternTranslator extends AbstractTranslator {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public JsExpression translateIsCheck(@NotNull JsExpression subject, @NotNull KtTypeReference typeReference) {
|
public JsExpression translateIsCheck(@NotNull JsExpression subject, @NotNull KtTypeReference typeReference) {
|
||||||
KotlinType type = BindingUtils.getTypeByReference(bindingContext(), typeReference);
|
KotlinType type = BindingUtils.getTypeByReference(bindingContext(), typeReference);
|
||||||
JsExpression checkFunReference = getIsTypeCheckCallable(type);
|
JsExpression checkFunReference = doGetIsTypeCheckCallable(type);
|
||||||
|
|
||||||
if (isReifiedTypeParameter(type) && findChildByType(typeReference, KtNodeTypes.NULLABLE_TYPE) != null) {
|
if (isReifiedTypeParameter(type) && findChildByType(typeReference, KtNodeTypes.NULLABLE_TYPE) != null) {
|
||||||
checkFunReference = namer().orNull(checkFunReference);
|
checkFunReference = namer().orNull(checkFunReference);
|
||||||
@@ -118,7 +118,7 @@ public final class PatternTranslator extends AbstractTranslator {
|
|||||||
public JsExpression getIsTypeCheckCallable(@NotNull KotlinType type) {
|
public JsExpression getIsTypeCheckCallable(@NotNull KotlinType type) {
|
||||||
JsExpression callable = doGetIsTypeCheckCallable(type);
|
JsExpression callable = doGetIsTypeCheckCallable(type);
|
||||||
|
|
||||||
if (isNullableType(type) && !isReifiedTypeParameter(type)) {
|
if (isNullableType(type)) {
|
||||||
return namer().orNull(callable);
|
return namer().orNull(callable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user