[K/N] Added couple of reproducers for KT-57791
This commit is contained in:
@@ -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)),
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user