We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffaedb5 commit 7100529Copy full SHA for 7100529
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -1208,6 +1208,7 @@ object Types {
1208
if tp.isOverloaded then tp else tp.underlying.widen
1209
case tp: SingletonType => tp.underlying.widen
1210
case tp: ExprType => tp.resultType.widen
1211
+ case tp: AndType => tp.derivedAndType(tp.tp1.widen, tp.tp2.widen)
1212
case tp =>
1213
val tp1 = tp.stripped
1214
if tp1 eq tp then tp
tests/explicit-nulls/pos/i13197.scala
@@ -0,0 +1,7 @@
1
+trait Bar:
2
+ def b: String | Null
3
+
4
+class Foo(a: String = "", b: String)
5
6
+object Foo:
7
+ def foo(bar: Bar) = Foo(b = bar.b.nn)
0 commit comments