File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed
src/compiler/scala/tools/nsc/transform/patmat Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -393,8 +393,9 @@ trait MatchTreeMaking extends MatchCodeGen with Debugging {
393393 case TypeRef (pre, _, _) if ! pre.isStable => // e.g. _: Outer#Inner
394394 false
395395 case TypeRef (pre, sym, args) =>
396- val testedBinderClass = testedBinder.info.upperBound.typeSymbol
397- // alternatively..... = testedBinder.info.baseClasses.find(_.isClass).getOrElse(NoSymbol)
396+ val testedBinderClass = testedBinder.info.baseClasses.find { sym =>
397+ sym.isClass && ! sym.isRefinementClass
398+ }.getOrElse(NoSymbol )
398399 val testedBinderType = testedBinder.info.baseType(testedBinderClass)
399400
400401 val testedPrefixIsExpectedTypePrefix = pre =:= testedBinderType.prefix
Original file line number Diff line number Diff line change 1+ // scalac: -Werror
12import scala .reflect .api .Universe
23
34object Test {
Original file line number Diff line number Diff line change 1+ // scalac: -Werror
2+ import scala .reflect .api .Universe
3+
4+ object Test {
5+ type SingletonUniverse = Universe with Singleton
6+
7+ def foo [U <: SingletonUniverse ](u : U )(typ : u.Type ): List [u.Annotation ] = typ match {
8+ case t : u.AnnotatedTypeApi => t.annotations // was: "The outer reference in this type test cannot be checked at run time."
9+ case _ => Nil
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ // scalac: -Werror
2+ import scala .reflect .api .Universe
3+
4+ object Test {
5+ type SingletonUniverse = Universe with Singleton
6+
7+ def foo [U <: SingletonUniverse ](u : U )(typ : U # Type ): List [U # Annotation ] = typ match {
8+ case t : U # AnnotatedTypeApi => t.annotations // as a comparison, this wasn't emitting a warning
9+ case _ => Nil
10+ }
11+ }
You can’t perform that action at this time.
0 commit comments