Files
kotlin-fork/kotlin-native/backend.native/tests/objcexport/variance.swift
T
Florian Kistner bd614aba0b Retain typed generics in ObjC export stubs (#4727)
* Add ObjC export test with disabled generics
* Retain typed generics in ObjC export stubs
* Introduce ObjC variance enum to decouple stubs from Kotlin variance

(cherry picked from commit 4d7c78b952a467ca3318c8c49d36b768fdc1ef9c)
2021-03-09 20:19:31 +00:00

31 lines
602 B
Swift

/*
* Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
import Foundation
import Kt
// -------- Tests --------
func testInstantiation() {
#if NO_GENERICS
Invariant()
OutVariant()
InVariant()
#else
Invariant<VarianceTests>()
OutVariant<VarianceTests>()
InVariant<VarianceTests>()
#endif
}
// -------- Execution of the test --------
class VarianceTests : SimpleTestProvider {
override init() {
super.init()
test("TestInstantiation", testInstantiation)
}
}