Sign in
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
9fc4d94d04f972782fee2dc5b3b25d052d88601a
/
.
/
compiler
/
testData
/
diagnostics
/
tests
/
smartCasts
/
varInsideLocalFun.fir.kt
blob: 907f31dd2a9ce7c6d4e03fe2d6932655e3df61b3 [
file
]
// Based on KT-8643
public
class
MyClass
{
fun main
()
{
var
str
:
String
?
=
null
if
(
str
!=
null
)
callback
{
// Nodoby writes str, smart cast is possible
method1
(
str
)
}
}
inline
fun callback
(
foo
:
()
->
Unit
)
=
foo
()
fun method1
(
str
:
String
)
=
str
}