JS frontend: additional check for nativeSetter -- check that the return type is either Unit or a supertype of the second parameter's type.
This commit is contained in:
+2
-2
@@ -43,10 +43,10 @@ class C {
|
||||
fun Int.set(a: String, v: Int)<!> {}
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun Int.set2(a: Number, v: String?)<!> = "OK"
|
||||
fun Int.<!NATIVE_SETTER_WRONG_RETURN_TYPE!>set2<!>(a: Number, v: String?)<!> = "OK"
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun Int.set3(a: Double, v: String?)<!> = "OK"
|
||||
fun Int.<!NATIVE_SETTER_WRONG_RETURN_TYPE!>set3<!>(a: Double, v: String?)<!> = "OK"
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
|
||||
fun set(): Any?<!> = null
|
||||
|
||||
Reference in New Issue
Block a user