[K/N] Added couple of reproducers for KT-57791

This commit is contained in:
Igor Chevdar
2023-04-26 16:28:47 +03:00
committed by Space Team
parent c46a95aad7
commit 197cba35eb
8 changed files with 213 additions and 0 deletions
@@ -0,0 +1,19 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
interface Foo {
fun bar(): String?
}
internal class FooImplUnused : Foo {
override fun bar(): String? = null
}
fun foobar(foo: Foo): Boolean {
val s = foo.bar()
if (s == null)
return false
return s == "zzz"
}
@@ -0,0 +1,21 @@
import Foundation
import Kt57791
class FooImpl : Foo {
func bar() -> String? { "zzz" }
}
func testKt57791() throws {
try assertTrue(KnlibraryKt.foobar(foo: FooImpl()))
}
class TestTests : TestProvider {
var tests: [TestCase] = []
init() {
providers.append(self)
tests = [
TestCase(name: "Kt57791", method: withAutorelease(testKt57791)),
]
}
}