-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14617 from dotty-staging/fix-intercept-TypeApply-…
…in-explicit-nulls Fix intercept TypeApply in explicit nulls
- Loading branch information
Showing
2 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Ensure we don't get "the type test for argType cannot be checked at runtime" warning | ||
|
||
class Symbol { | ||
type ThisName | ||
} | ||
|
||
type TermSymbol = Symbol { type ThisName = String } | ||
|
||
type TermSymbolOrNull = TermSymbol | Null | ||
|
||
def testSimple = | ||
val x: Symbol | Null = ??? | ||
x match | ||
case key: Symbol => 1 | ||
case null => 0 | ||
|
||
def testWithRefinedType = | ||
val x: TermSymbol | Null = ??? | ||
x match | ||
case key: TermSymbol => 1 | ||
case null => 0 | ||
|
||
def testWithAlias = | ||
val x: TermSymbolOrNull = ??? | ||
x match | ||
case key: TermSymbol => 1 | ||
case null => 0 |