File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/core
tests/explicit-nulls/unsafe-common Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ object Types {
237
237
}
238
238
239
239
def isBottomType (using Context ): Boolean =
240
- if ctx.explicitNulls && ! ctx.phase.erasedTypes then hasClassSymbol(defn.NothingClass )
240
+ if ctx.mode.is( Mode . SafeNulls ) && ! ctx.phase.erasedTypes then hasClassSymbol(defn.NothingClass )
241
241
else isBottomTypeAfterErasure
242
242
243
243
def isBottomTypeAfterErasure (using Context ): Boolean =
Original file line number Diff line number Diff line change
1
+ import java .util .ArrayList
2
+
3
+ def f [T ]: ArrayList [T ] = {
4
+ val cz = Class .forName(" java.util.ArrayList" )
5
+ val o = cz.newInstance() // error: T of Class[?] | Null
6
+ o.asInstanceOf [ArrayList [T ]]
7
+ }
You can’t perform that action at this time.
0 commit comments