Skip to content

Commit a781883

Browse files
committed
Add test without explicit-nulls
1 parent 224b13b commit a781883

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/pos/i13197.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// this test is similar to explicit-nulls/pos/i13197.scala, but without explicit nulls
2+
3+
extension [T](x: T | String) inline def forceString: x.type & String =
4+
x.asInstanceOf
5+
6+
trait Bar:
7+
def b: String | Int
8+
9+
class Foo(a: String = "", b: Any)
10+
11+
object Foo:
12+
def foo(bar: Bar) = Foo(b = bar.b.forceString)

0 commit comments

Comments
 (0)