From 6b336f86d677f5aedd40bd673cdd7ffbea780fbd Mon Sep 17 00:00:00 2001 From: Vlad Ureche Date: Sun, 23 Aug 2015 03:55:48 +0200 Subject: SI-9442 Fix the uncurry-erasure types Using the "uncurry-erased" type (the one after the uncurry phase) can lead to incorrect tree transformations. For example, compiling: ``` def foo(c: Ctx)(l: c.Tree): Unit = { val l2: c.Tree = l } ``` Results in the following AST: ``` def foo(c: Ctx, l: Ctx#Tree): Unit = { val l$1: Ctx#Tree = l.asInstanceOf[Ctx#Tree] val l2: c.Tree = l$1 // no, not really, it's not. } ``` Of course, this is incorrect, since `l$1` has type `Ctx#Tree`, which is not a subtype of `c.Tree`. So what we need to do is to use the pre-uncurry type when creating `l$1`, which is `c.Tree` and is correct. Now, there are two additional problems: 1. when varargs and byname params are involved, the uncurry transformation desugares these special cases to actual typerefs, eg: ``` T* ~> Seq[T] (Scala-defined varargs) T* ~> Array[T] (Java-defined varargs) =>T ~> Function0[T] (by name params) ``` we use the DesugaredParameterType object (defined in scala.reflect.internal.transform.UnCurry) to redo this desugaring manually here 2. the type needs to be normalized, since `gen.mkCast` checks this (no HK here, just aliases have to be expanded before handing the type to `gen.mkAttributedCast`, which calls `gen.mkCast`) --- test/files/pos/t9442.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/files/pos/t9442.scala (limited to 'test') diff --git a/test/files/pos/t9442.scala b/test/files/pos/t9442.scala new file mode 100644 index 0000000000..2ea81e79cb --- /dev/null +++ b/test/files/pos/t9442.scala @@ -0,0 +1,14 @@ +trait Ctx { + trait Tree +} +trait Lst[+A] { + def zip[A1 >: A, B](that: Lst[B]): Nothing +} +class C[@specialized(Int) T] { + def moo(t: T) = { + def foo1(c: Ctx)(l: Lst[c.Tree]) = l zip l + def foo2(c: Ctx)(l: Lst[c.Tree]*) = l(0) zip l(1) + def foo3(c: Ctx)(l: => Lst[c.Tree]) = l zip l + ??? + } +} -- cgit v1.2.3 From 2374561288799a5d59d7f7bead9e3734ae956cc4 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Wed, 2 Sep 2015 18:21:16 -0400 Subject: unset inappropriate execute bits I imagine these date back to old Subversion days and are probably the result of inadvertent commits from Windows users with vcs client configs. having the bit set isn't really harmful most of the time, but it's just not right, and it makes the files stand out in directory listings for no reason --- build.xml | 0 src/compiler/scala/tools/nsc/ast/DocComments.scala | 0 src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala | 0 src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala | 0 src/compiler/scala/tools/nsc/ast/parser/xml/Utility.scala | 0 src/compiler/scala/tools/nsc/util/DocStrings.scala | 0 src/library/scala/collection/IndexedSeqOptimized.scala | 0 src/library/scala/collection/JavaConverters.scala | 0 src/library/scala/collection/LinearSeqOptimized.scala | 0 src/library/scala/collection/generic/FilterMonadic.scala | 0 src/library/scala/collection/generic/HasNewBuilder.scala | 0 src/library/scala/collection/immutable/DefaultMap.scala | 0 src/library/scala/collection/mutable/IndexedSeqOptimized.scala | 0 src/library/scala/collection/readme-if-you-want-to-add-something.txt | 0 src/library/scala/reflect/NameTransformer.scala | 0 src/library/scala/runtime/TraitSetter.java | 0 src/library/scala/runtime/VolatileBooleanRef.java | 0 src/library/scala/runtime/VolatileByteRef.java | 0 src/library/scala/runtime/VolatileCharRef.java | 0 src/library/scala/runtime/VolatileDoubleRef.java | 0 src/library/scala/runtime/VolatileFloatRef.java | 0 src/library/scala/runtime/VolatileIntRef.java | 0 src/library/scala/runtime/VolatileLongRef.java | 0 src/library/scala/runtime/VolatileObjectRef.java | 0 src/library/scala/runtime/VolatileShortRef.java | 0 src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala | 0 src/scaladoc/scala/tools/nsc/doc/base/LinkTo.scala | 0 src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala | 0 src/scaladoc/scala/tools/nsc/doc/base/comment/Body.scala | 0 src/scaladoc/scala/tools/nsc/doc/html/page/DeprecatedIndex.scala | 0 src/scaladoc/scala/tools/nsc/doc/html/page/ReferenceIndex.scala | 0 src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery-ui.js | 0 src/scaladoc/scala/tools/nsc/doc/html/resource/lib/ref-index.css | 0 src/scaladoc/scala/tools/nsc/doc/model/IndexModelFactory.scala | 0 src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala | 0 test/disabled/pos/t1545.scala | 0 test/files/bench/equality/eq.scala | 0 test/files/bench/equality/eqeq.scala | 0 test/files/neg/override.scala | 0 test/files/neg/t2336.scala | 0 test/files/neg/t2494.scala | 0 test/files/neg/t2773.scala | 0 test/files/neg/t2779.scala | 0 test/files/neg/t2870.scala | 0 test/files/neg/t2918.scala | 0 test/files/neg/t3006.scala | 0 test/files/neg/t3224.scala | 0 test/files/neg/t6446-additional.check | 0 test/files/neg/t6446-list.check | 0 test/files/neg/t6446-missing.check | 0 test/files/neg/t771.scala | 0 test/files/pos/lexical.scala | 0 test/files/pos/packageobjs.scala | 0 test/files/pos/spec-t6286.scala | 0 test/files/pos/t1459/AbstractBase.java | 0 test/files/pos/t1459/App.scala | 0 test/files/pos/t1459/Caller.java | 0 test/files/pos/t1722/Test.scala | 0 test/files/pos/t1722/Top.scala | 0 test/files/pos/t1756.scala | 0 test/files/pos/t2060.scala | 0 test/files/pos/t2082.scala | 0 test/files/pos/t2179.scala | 0 test/files/pos/t2425.scala | 0 test/files/pos/t2429.scala | 0 test/files/pos/t2433/A.java | 0 test/files/pos/t2433/B.java | 0 test/files/pos/t2433/Test.scala | 0 test/files/pos/t2484.scala | 0 test/files/pos/t2504.scala | 0 test/files/pos/t2545.scala | 0 test/files/pos/t2635.scala | 0 test/files/pos/t2683.scala | 0 test/files/pos/t2913.scala | 0 test/files/pos/t2956/t2956.scala | 0 test/files/pos/t3174.scala | 0 test/files/pos/t3174b.scala | 0 test/files/pos/t3568.scala | 0 test/files/pos/t4553.scala | 0 test/files/presentation/doc/doc.scala | 0 test/files/presentation/doc/src/Class.scala | 0 test/files/presentation/doc/src/p/Base.scala | 0 test/files/presentation/doc/src/p/Derived.scala | 0 test/files/run/list_map.scala | 0 test/files/run/t2127.scala | 0 test/files/run/t2503.scala | 0 test/files/run/t3026.scala | 0 test/files/run/t5699.check | 0 test/files/run/t5699.scala | 0 test/files/run/t5717.scala | 0 test/files/run/t7246.check | 0 test/files/run/t7246/Outer.java | 0 test/files/run/t7246/Test.scala | 0 test/files/run/t7246b.check | 0 test/files/run/t7246b/Base.scala | 0 test/files/run/t7246b/Outer.java | 0 test/files/run/t7246b/Test.scala | 0 test/files/run/t7341.flags | 0 test/files/run/t7341.scala | 0 test/files/run/viewtest.scala | 0 test/files/run/weakconform.scala | 0 test/pending/run/t3609.scala | 0 test/scaladoc/run/SI-191.check | 0 test/scaladoc/run/SI-191.scala | 0 test/scaladoc/run/SI-7367.check | 0 test/scaladoc/run/SI-7367.scala | 0 test/scaladoc/run/SI-8479.scala | 0 test/script-tests/README | 0 108 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 build.xml mode change 100755 => 100644 src/compiler/scala/tools/nsc/ast/DocComments.scala mode change 100755 => 100644 src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala mode change 100755 => 100644 src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala mode change 100755 => 100644 src/compiler/scala/tools/nsc/ast/parser/xml/Utility.scala mode change 100755 => 100644 src/compiler/scala/tools/nsc/util/DocStrings.scala mode change 100755 => 100644 src/library/scala/collection/IndexedSeqOptimized.scala mode change 100755 => 100644 src/library/scala/collection/JavaConverters.scala mode change 100755 => 100644 src/library/scala/collection/LinearSeqOptimized.scala mode change 100755 => 100644 src/library/scala/collection/generic/FilterMonadic.scala mode change 100755 => 100644 src/library/scala/collection/generic/HasNewBuilder.scala mode change 100755 => 100644 src/library/scala/collection/immutable/DefaultMap.scala mode change 100755 => 100644 src/library/scala/collection/mutable/IndexedSeqOptimized.scala mode change 100755 => 100644 src/library/scala/collection/readme-if-you-want-to-add-something.txt mode change 100755 => 100644 src/library/scala/reflect/NameTransformer.scala mode change 100755 => 100644 src/library/scala/runtime/TraitSetter.java mode change 100755 => 100644 src/library/scala/runtime/VolatileBooleanRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileByteRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileCharRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileDoubleRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileFloatRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileIntRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileLongRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileObjectRef.java mode change 100755 => 100644 src/library/scala/runtime/VolatileShortRef.java mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/base/LinkTo.scala mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/base/comment/Body.scala mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/html/page/DeprecatedIndex.scala mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/html/page/ReferenceIndex.scala mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery-ui.js mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/html/resource/lib/ref-index.css mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/model/IndexModelFactory.scala mode change 100755 => 100644 src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala mode change 100755 => 100644 test/disabled/pos/t1545.scala mode change 100755 => 100644 test/files/bench/equality/eq.scala mode change 100755 => 100644 test/files/bench/equality/eqeq.scala mode change 100755 => 100644 test/files/neg/override.scala mode change 100755 => 100644 test/files/neg/t2336.scala mode change 100755 => 100644 test/files/neg/t2494.scala mode change 100755 => 100644 test/files/neg/t2773.scala mode change 100755 => 100644 test/files/neg/t2779.scala mode change 100755 => 100644 test/files/neg/t2870.scala mode change 100755 => 100644 test/files/neg/t2918.scala mode change 100755 => 100644 test/files/neg/t3006.scala mode change 100755 => 100644 test/files/neg/t3224.scala mode change 100755 => 100644 test/files/neg/t6446-additional.check mode change 100755 => 100644 test/files/neg/t6446-list.check mode change 100755 => 100644 test/files/neg/t6446-missing.check mode change 100755 => 100644 test/files/neg/t771.scala mode change 100755 => 100644 test/files/pos/lexical.scala mode change 100755 => 100644 test/files/pos/packageobjs.scala mode change 100755 => 100644 test/files/pos/spec-t6286.scala mode change 100755 => 100644 test/files/pos/t1459/AbstractBase.java mode change 100755 => 100644 test/files/pos/t1459/App.scala mode change 100755 => 100644 test/files/pos/t1459/Caller.java mode change 100755 => 100644 test/files/pos/t1722/Test.scala mode change 100755 => 100644 test/files/pos/t1722/Top.scala mode change 100755 => 100644 test/files/pos/t1756.scala mode change 100755 => 100644 test/files/pos/t2060.scala mode change 100755 => 100644 test/files/pos/t2082.scala mode change 100755 => 100644 test/files/pos/t2179.scala mode change 100755 => 100644 test/files/pos/t2425.scala mode change 100755 => 100644 test/files/pos/t2429.scala mode change 100755 => 100644 test/files/pos/t2433/A.java mode change 100755 => 100644 test/files/pos/t2433/B.java mode change 100755 => 100644 test/files/pos/t2433/Test.scala mode change 100755 => 100644 test/files/pos/t2484.scala mode change 100755 => 100644 test/files/pos/t2504.scala mode change 100755 => 100644 test/files/pos/t2545.scala mode change 100755 => 100644 test/files/pos/t2635.scala mode change 100755 => 100644 test/files/pos/t2683.scala mode change 100755 => 100644 test/files/pos/t2913.scala mode change 100755 => 100644 test/files/pos/t2956/t2956.scala mode change 100755 => 100644 test/files/pos/t3174.scala mode change 100755 => 100644 test/files/pos/t3174b.scala mode change 100755 => 100644 test/files/pos/t3568.scala mode change 100755 => 100644 test/files/pos/t4553.scala mode change 100755 => 100644 test/files/presentation/doc/doc.scala mode change 100755 => 100644 test/files/presentation/doc/src/Class.scala mode change 100755 => 100644 test/files/presentation/doc/src/p/Base.scala mode change 100755 => 100644 test/files/presentation/doc/src/p/Derived.scala mode change 100755 => 100644 test/files/run/list_map.scala mode change 100755 => 100644 test/files/run/t2127.scala mode change 100755 => 100644 test/files/run/t2503.scala mode change 100755 => 100644 test/files/run/t3026.scala mode change 100755 => 100644 test/files/run/t5699.check mode change 100755 => 100644 test/files/run/t5699.scala mode change 100755 => 100644 test/files/run/t5717.scala mode change 100755 => 100644 test/files/run/t7246.check mode change 100755 => 100644 test/files/run/t7246/Outer.java mode change 100755 => 100644 test/files/run/t7246/Test.scala mode change 100755 => 100644 test/files/run/t7246b.check mode change 100755 => 100644 test/files/run/t7246b/Base.scala mode change 100755 => 100644 test/files/run/t7246b/Outer.java mode change 100755 => 100644 test/files/run/t7246b/Test.scala mode change 100755 => 100644 test/files/run/t7341.flags mode change 100755 => 100644 test/files/run/t7341.scala mode change 100755 => 100644 test/files/run/viewtest.scala mode change 100755 => 100644 test/files/run/weakconform.scala mode change 100755 => 100644 test/pending/run/t3609.scala mode change 100755 => 100644 test/scaladoc/run/SI-191.check mode change 100755 => 100644 test/scaladoc/run/SI-191.scala mode change 100755 => 100644 test/scaladoc/run/SI-7367.check mode change 100755 => 100644 test/scaladoc/run/SI-7367.scala mode change 100755 => 100644 test/scaladoc/run/SI-8479.scala mode change 100755 => 100644 test/script-tests/README (limited to 'test') diff --git a/build.xml b/build.xml old mode 100755 new mode 100644 diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala old mode 100755 new mode 100644 diff --git a/src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala b/src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala old mode 100755 new mode 100644 diff --git a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala old mode 100755 new mode 100644 diff --git a/src/compiler/scala/tools/nsc/ast/parser/xml/Utility.scala b/src/compiler/scala/tools/nsc/ast/parser/xml/Utility.scala old mode 100755 new mode 100644 diff --git a/src/compiler/scala/tools/nsc/util/DocStrings.scala b/src/compiler/scala/tools/nsc/util/DocStrings.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/IndexedSeqOptimized.scala b/src/library/scala/collection/IndexedSeqOptimized.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/JavaConverters.scala b/src/library/scala/collection/JavaConverters.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/LinearSeqOptimized.scala b/src/library/scala/collection/LinearSeqOptimized.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/generic/FilterMonadic.scala b/src/library/scala/collection/generic/FilterMonadic.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/generic/HasNewBuilder.scala b/src/library/scala/collection/generic/HasNewBuilder.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/immutable/DefaultMap.scala b/src/library/scala/collection/immutable/DefaultMap.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/mutable/IndexedSeqOptimized.scala b/src/library/scala/collection/mutable/IndexedSeqOptimized.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/collection/readme-if-you-want-to-add-something.txt b/src/library/scala/collection/readme-if-you-want-to-add-something.txt old mode 100755 new mode 100644 diff --git a/src/library/scala/reflect/NameTransformer.scala b/src/library/scala/reflect/NameTransformer.scala old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/TraitSetter.java b/src/library/scala/runtime/TraitSetter.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileBooleanRef.java b/src/library/scala/runtime/VolatileBooleanRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileByteRef.java b/src/library/scala/runtime/VolatileByteRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileCharRef.java b/src/library/scala/runtime/VolatileCharRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileDoubleRef.java b/src/library/scala/runtime/VolatileDoubleRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileFloatRef.java b/src/library/scala/runtime/VolatileFloatRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileIntRef.java b/src/library/scala/runtime/VolatileIntRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileLongRef.java b/src/library/scala/runtime/VolatileLongRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileObjectRef.java b/src/library/scala/runtime/VolatileObjectRef.java old mode 100755 new mode 100644 diff --git a/src/library/scala/runtime/VolatileShortRef.java b/src/library/scala/runtime/VolatileShortRef.java old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala b/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/base/LinkTo.scala b/src/scaladoc/scala/tools/nsc/doc/base/LinkTo.scala old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala b/src/scaladoc/scala/tools/nsc/doc/base/MemberLookupBase.scala old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/base/comment/Body.scala b/src/scaladoc/scala/tools/nsc/doc/base/comment/Body.scala old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/DeprecatedIndex.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/DeprecatedIndex.scala old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/ReferenceIndex.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/ReferenceIndex.scala old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery-ui.js b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery-ui.js old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/ref-index.css b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/ref-index.css old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/model/IndexModelFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/IndexModelFactory.scala old mode 100755 new mode 100644 diff --git a/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala old mode 100755 new mode 100644 diff --git a/test/disabled/pos/t1545.scala b/test/disabled/pos/t1545.scala old mode 100755 new mode 100644 diff --git a/test/files/bench/equality/eq.scala b/test/files/bench/equality/eq.scala old mode 100755 new mode 100644 diff --git a/test/files/bench/equality/eqeq.scala b/test/files/bench/equality/eqeq.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/override.scala b/test/files/neg/override.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t2336.scala b/test/files/neg/t2336.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t2494.scala b/test/files/neg/t2494.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t2773.scala b/test/files/neg/t2773.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t2779.scala b/test/files/neg/t2779.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t2870.scala b/test/files/neg/t2870.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t2918.scala b/test/files/neg/t2918.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t3006.scala b/test/files/neg/t3006.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t3224.scala b/test/files/neg/t3224.scala old mode 100755 new mode 100644 diff --git a/test/files/neg/t6446-additional.check b/test/files/neg/t6446-additional.check old mode 100755 new mode 100644 diff --git a/test/files/neg/t6446-list.check b/test/files/neg/t6446-list.check old mode 100755 new mode 100644 diff --git a/test/files/neg/t6446-missing.check b/test/files/neg/t6446-missing.check old mode 100755 new mode 100644 diff --git a/test/files/neg/t771.scala b/test/files/neg/t771.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/lexical.scala b/test/files/pos/lexical.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/packageobjs.scala b/test/files/pos/packageobjs.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/spec-t6286.scala b/test/files/pos/spec-t6286.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t1459/AbstractBase.java b/test/files/pos/t1459/AbstractBase.java old mode 100755 new mode 100644 diff --git a/test/files/pos/t1459/App.scala b/test/files/pos/t1459/App.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t1459/Caller.java b/test/files/pos/t1459/Caller.java old mode 100755 new mode 100644 diff --git a/test/files/pos/t1722/Test.scala b/test/files/pos/t1722/Test.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t1722/Top.scala b/test/files/pos/t1722/Top.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t1756.scala b/test/files/pos/t1756.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2060.scala b/test/files/pos/t2060.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2082.scala b/test/files/pos/t2082.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2179.scala b/test/files/pos/t2179.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2425.scala b/test/files/pos/t2425.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2429.scala b/test/files/pos/t2429.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2433/A.java b/test/files/pos/t2433/A.java old mode 100755 new mode 100644 diff --git a/test/files/pos/t2433/B.java b/test/files/pos/t2433/B.java old mode 100755 new mode 100644 diff --git a/test/files/pos/t2433/Test.scala b/test/files/pos/t2433/Test.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2484.scala b/test/files/pos/t2484.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2504.scala b/test/files/pos/t2504.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2545.scala b/test/files/pos/t2545.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2635.scala b/test/files/pos/t2635.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2683.scala b/test/files/pos/t2683.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2913.scala b/test/files/pos/t2913.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t2956/t2956.scala b/test/files/pos/t2956/t2956.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t3174.scala b/test/files/pos/t3174.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t3174b.scala b/test/files/pos/t3174b.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t3568.scala b/test/files/pos/t3568.scala old mode 100755 new mode 100644 diff --git a/test/files/pos/t4553.scala b/test/files/pos/t4553.scala old mode 100755 new mode 100644 diff --git a/test/files/presentation/doc/doc.scala b/test/files/presentation/doc/doc.scala old mode 100755 new mode 100644 diff --git a/test/files/presentation/doc/src/Class.scala b/test/files/presentation/doc/src/Class.scala old mode 100755 new mode 100644 diff --git a/test/files/presentation/doc/src/p/Base.scala b/test/files/presentation/doc/src/p/Base.scala old mode 100755 new mode 100644 diff --git a/test/files/presentation/doc/src/p/Derived.scala b/test/files/presentation/doc/src/p/Derived.scala old mode 100755 new mode 100644 diff --git a/test/files/run/list_map.scala b/test/files/run/list_map.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t2127.scala b/test/files/run/t2127.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t2503.scala b/test/files/run/t2503.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t3026.scala b/test/files/run/t3026.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t5699.check b/test/files/run/t5699.check old mode 100755 new mode 100644 diff --git a/test/files/run/t5699.scala b/test/files/run/t5699.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t5717.scala b/test/files/run/t5717.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t7246.check b/test/files/run/t7246.check old mode 100755 new mode 100644 diff --git a/test/files/run/t7246/Outer.java b/test/files/run/t7246/Outer.java old mode 100755 new mode 100644 diff --git a/test/files/run/t7246/Test.scala b/test/files/run/t7246/Test.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t7246b.check b/test/files/run/t7246b.check old mode 100755 new mode 100644 diff --git a/test/files/run/t7246b/Base.scala b/test/files/run/t7246b/Base.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t7246b/Outer.java b/test/files/run/t7246b/Outer.java old mode 100755 new mode 100644 diff --git a/test/files/run/t7246b/Test.scala b/test/files/run/t7246b/Test.scala old mode 100755 new mode 100644 diff --git a/test/files/run/t7341.flags b/test/files/run/t7341.flags old mode 100755 new mode 100644 diff --git a/test/files/run/t7341.scala b/test/files/run/t7341.scala old mode 100755 new mode 100644 diff --git a/test/files/run/viewtest.scala b/test/files/run/viewtest.scala old mode 100755 new mode 100644 diff --git a/test/files/run/weakconform.scala b/test/files/run/weakconform.scala old mode 100755 new mode 100644 diff --git a/test/pending/run/t3609.scala b/test/pending/run/t3609.scala old mode 100755 new mode 100644 diff --git a/test/scaladoc/run/SI-191.check b/test/scaladoc/run/SI-191.check old mode 100755 new mode 100644 diff --git a/test/scaladoc/run/SI-191.scala b/test/scaladoc/run/SI-191.scala old mode 100755 new mode 100644 diff --git a/test/scaladoc/run/SI-7367.check b/test/scaladoc/run/SI-7367.check old mode 100755 new mode 100644 diff --git a/test/scaladoc/run/SI-7367.scala b/test/scaladoc/run/SI-7367.scala old mode 100755 new mode 100644 diff --git a/test/scaladoc/run/SI-8479.scala b/test/scaladoc/run/SI-8479.scala old mode 100755 new mode 100644 diff --git a/test/script-tests/README b/test/script-tests/README old mode 100755 new mode 100644 -- cgit v1.2.3 From bdba16f5de91c4a8ac345c345a674f4ba56b542b Mon Sep 17 00:00:00 2001 From: Gerard Basler Date: Sat, 12 Sep 2015 19:38:22 +0200 Subject: SI-9369 Fix pattern matcher warnings for diamond shaped inheritance. A previous optimization (d44a86f432a7f9ca250b014acdeab02ac9f2c304) for pattern matcher exhaustivity checks used a smarter encoding to ensure that the scrutinee can be equal to one child only. However, in case of traits between the root and leave type, a child can be of several types and these types should not be in a mutually exclusive group. A simple solution (hat tip to retronym) is to just put traits and classes into separate groups. --- .../tools/nsc/transform/patmat/MatchAnalysis.scala | 6 +++++- test/files/pos/t9369.flags | 1 + test/files/pos/t9369.scala | 24 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test/files/pos/t9369.flags create mode 100644 test/files/pos/t9369.scala (limited to 'test') diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala index a11906ace1..1331eb6993 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala @@ -150,7 +150,11 @@ trait TreeAndTypeAnalysis extends Debugging { acc: List[List[Type]]): List[List[Type]] = wl match { case hd :: tl => val children = enumerateChildren(hd) - groupChildren(tl ++ children, acc :+ filterChildren(children)) + // put each trait in a new group, since traits could belong to the same + // group as a derived class + val (traits, nonTraits) = children.partition(_.isTrait) + val filtered = (traits.map(List(_)) ++ List(nonTraits)).map(filterChildren) + groupChildren(tl ++ children, acc ++ filtered) case Nil => acc } diff --git a/test/files/pos/t9369.flags b/test/files/pos/t9369.flags new file mode 100644 index 0000000000..b5a8748652 --- /dev/null +++ b/test/files/pos/t9369.flags @@ -0,0 +1 @@ +-Xfatal-warnings -unchecked diff --git a/test/files/pos/t9369.scala b/test/files/pos/t9369.scala new file mode 100644 index 0000000000..94be2ea4e7 --- /dev/null +++ b/test/files/pos/t9369.scala @@ -0,0 +1,24 @@ +object Test { + + trait Tree + + sealed abstract class Prop + + trait Simple extends Prop + + case class Atom(tree: Tree) extends Prop with Simple + + case class Not(prop: Prop) extends Prop with Simple + + def simplify1(prop: Prop): Prop = prop match { + case Atom(tree) => ??? + case Not(prop) => ??? + case _ => ??? + } + + def simplify2(prop: Prop): Prop = prop match { + case Not(Atom(tree)) => ??? + case Not(Not(prop)) => ??? + case _ => ??? + } +} \ No newline at end of file -- cgit v1.2.3