File tree 3 files changed +7
-6
lines changed
src/dotty/tools/dotc/core
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -450,7 +450,7 @@ class TypeComparer(initctx: Context) extends DotClass {
450
450
tp1 match {
451
451
case tp1 : NamedType =>
452
452
val sym1 = tp1.symbol
453
- (if (sym1 eq tp2.symbol) (
453
+ (if (( sym1 ne NoSymbol ) && (sym1 eq tp2.symbol) ) (
454
454
ctx.erasedTypes
455
455
|| sym1.isStaticOwner
456
456
|| { // Implements: A # X <: B # X
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ class tests extends CompilerTest {
95
95
@ Test def neg_t1843_variances = compileFile(negDir, " t1843-variances" , xerrors = 1 )
96
96
@ Test def neg_t2660_ambi = compileFile(negDir, " t2660" , xerrors = 2 )
97
97
@ Test def neg_t2994 = compileFile(negDir, " t2994" , xerrors = 2 )
98
- @ Test def neg_subtyping = compileFile(negDir, " subtyping" , xerrors = 1 )
98
+ @ Test def neg_subtyping = compileFile(negDir, " subtyping" , xerrors = 2 )
99
99
@ Test def neg_variances = compileFile(negDir, " variances" , xerrors = 2 )
100
100
@ Test def neg_badAuxConstr = compileFile(negDir, " badAuxConstr" , xerrors = 2 )
101
101
@ Test def neg_typetest = compileFile(negDir, " typetest" , xerrors = 1 )
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ class B {
4
4
class A extends B
5
5
6
6
object Test {
7
- def foo ( a : A # X ): Unit = {
8
- return ;
7
+ def test1 ( ): Unit = {
8
+ implicitly[ B # X <:< A # X ]
9
9
}
10
- def test (): Unit = {
11
- foo(??? : B # X );
10
+ def test2 (): Unit = {
11
+ val a : { type T ; type U } = ???
12
+ implicitly[a.T <:< a.U ]
12
13
}
13
14
}
You can’t perform that action at this time.
0 commit comments