JS: fixes after code review
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@ class PatternMatchingTypingVisitor internal constructor(facade: ExpressionTyping
|
||||
subject = leftHandSide,
|
||||
sourceType = knownType,
|
||||
targetType = rhsType,
|
||||
operation = RttiOperation.IS
|
||||
operation = if (expression.isNegated) RttiOperation.NOT_IS else RttiOperation.IS
|
||||
)
|
||||
components.rttiExpressionCheckers.forEach {
|
||||
it.check(rttiInformation, expression, context.trace)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package
|
||||
|
||||
public fun box(/*0*/ a: kotlin.Any, /*1*/ b: kotlin.Any): kotlin.Pair<I, I?>
|
||||
|
||||
@kotlin.js.native() public interface I {
|
||||
@kotlin.js.native public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package
|
||||
|
||||
public fun box(/*0*/ a: kotlin.Any, /*1*/ b: kotlin.Any): kotlin.Boolean
|
||||
|
||||
@kotlin.js.native() public interface I {
|
||||
@kotlin.js.native public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
Vendored
+2
-2
@@ -14,8 +14,8 @@ fun bar() {
|
||||
foo(C())
|
||||
|
||||
val c: I = C()
|
||||
foo(<!NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>c<!>)
|
||||
<!NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>foo(c)<!>
|
||||
foo<<!NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>I<!>>(C())
|
||||
|
||||
C() + <!NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>c<!>
|
||||
<!NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>C() + c<!>
|
||||
}
|
||||
compiler/testData/diagnostics/testsWithJsStdLib/native/rtti/nativeInterfaceAsReifiedTypeArgument.txt
Vendored
+2
-2
@@ -4,14 +4,14 @@ public fun bar(): kotlin.Unit
|
||||
public inline fun </*0*/ reified T> foo(/*0*/ x: T): kotlin.Unit
|
||||
public operator inline fun </*0*/ reified T> C.plus(/*0*/ other: T): C
|
||||
|
||||
@kotlin.js.native() public final class C : I {
|
||||
@kotlin.js.native public final class C : I {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.js.native() public interface I {
|
||||
@kotlin.js.native public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
+2
-2
@@ -2,13 +2,13 @@ package
|
||||
|
||||
public fun box(/*0*/ a: kotlin.Any): kotlin.Int
|
||||
|
||||
@kotlin.js.native() public interface I {
|
||||
@kotlin.js.native public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.js.native() public interface J {
|
||||
@kotlin.js.native public interface J {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ private val DIAGNOSTIC_FACTORY_TO_RENDERER by lazy {
|
||||
put(ErrorsJs.JS_NAME_PROHIBITED_FOR_NAMED_NATIVE, "@JsName is prohibited for @native declaration with explicit name")
|
||||
put(ErrorsJs.CANNOT_CHECK_FOR_NATIVE_INTERFACE, "Cannot check for native interface: {0}", RENDER_TYPE)
|
||||
put(ErrorsJs.UNCHECKED_CAST_TO_NATIVE_INTERFACE, "Unchecked cast to native interface: {0} to {1}", RENDER_TYPE, RENDER_TYPE)
|
||||
put(ErrorsJs.NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT, "Cannot pass native interface {0} to reified type parameter", RENDER_TYPE)
|
||||
put(ErrorsJs.NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT, "Cannot pass native interface {0} for reified type parameter", RENDER_TYPE)
|
||||
|
||||
this
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class JsReifiedNativeChecker : CallChecker {
|
||||
typeArgumentList[typeParam.index].typeReference
|
||||
}
|
||||
else {
|
||||
resolvedCall.call.valueArguments[typeParam.index].getArgumentExpression()
|
||||
resolvedCall.call.callElement
|
||||
}
|
||||
|
||||
context.trace.report(ErrorsJs.NATIVE_INTERFACE_AS_REIFIED_TYPE_ARGUMENT.on(typeArgumentPsi!!, typeArg))
|
||||
|
||||
Reference in New Issue
Block a user