From dd89b006218d76a74d0185392d5e427c0867a33c Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sat, 23 Mar 2013 08:59:51 +0100 Subject: SI-7285 Fix match analysis with nested objects. The fix for SI-6146 introduced `nestedMemberType` to enumerate sealed subtypes based on the (prefixed) type of the scrutinee and the symbols of its sealed subclasses. That method needed to widen `ThisType(modSym)`s to `ModuleTypeRef(modSym)` before calling `asSeenFrom`. However, this could lead to confused in the match analysis, which sees `ModuleTypeRef` as distinct from singleton types on the same modules (after all, they aren't =:=). Spurious warnings ensued. This commit makes two changes: - conditionally re-narrow the result of `asSeenFrom` in `nestedMemberType`. - present `a.b.SomeModule.type` as `SomeModule` in warnings emitted by the pattern matcher. --- test/files/run/t6146b.check | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test/files/run') diff --git a/test/files/run/t6146b.check b/test/files/run/t6146b.check index e08e40d9fa..49ff70697e 100644 --- a/test/files/run/t6146b.check +++ b/test/files/run/t6146b.check @@ -43,10 +43,7 @@ mt1: u.Type = O.X.S1.type scala> global.typeDeconstruct.show(mt1) res0: String = TypeRef( - pre = TypeRef( - pre = ThisType(object O) - TypeSymbol(class X extends AnyRef) - ) + pre = SingleType(pre = ThisType(object O), object X) TypeSymbol(class S1 extends C.this.F[T]) ) -- cgit v1.2.3