File tree 3 files changed +13
-10
lines changed
compiler/src/dotty/tools/dotc/ast 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -1440,7 +1440,7 @@ object desugar {
1440
1440
def collect (tree : Tree ): Unit = tree match {
1441
1441
case Bind (nme.WILDCARD , tree1) =>
1442
1442
collect(tree1)
1443
- case tree @ Bind (_, Typed (tree1, tpt)) if ! mayBeTypePat(tpt) =>
1443
+ case tree @ Bind (_, Typed (tree1, tpt)) =>
1444
1444
add(tree, tpt)
1445
1445
collect(tree1)
1446
1446
case tree @ Bind (_, tree1) =>
Original file line number Diff line number Diff line change @@ -164,15 +164,6 @@ trait TreeInfo[T >: Untyped <: Type] { self: Trees.Instance[T] =>
164
164
/** Is name a left-associative operator? */
165
165
def isLeftAssoc (operator : Name ): Boolean = ! operator.isEmpty && (operator.toSimpleName.last != ':' )
166
166
167
- /** can this type be a type pattern? */
168
- def mayBeTypePat (tree : Tree ): Boolean = unsplice(tree) match {
169
- case RefinedTypeTree (tpt, refinements) => mayBeTypePat(tpt) || refinements.exists(_.isInstanceOf [Bind ])
170
- case AppliedTypeTree (tpt, args) => mayBeTypePat(tpt) || args.exists(_.isInstanceOf [Bind ])
171
- case Select (tpt, _) => mayBeTypePat(tpt)
172
- case Annotated (tpt, _) => mayBeTypePat(tpt)
173
- case _ => false
174
- }
175
-
176
167
/** Is this argument node of the form <expr> : _*, or is it a reference to
177
168
* such an argument ? The latter case can happen when an argument is lifted.
178
169
*/
Original file line number Diff line number Diff line change
1
+ object Test {
2
+
3
+ (??? : Any ) match {
4
+
5
+ case x1 | y1 => ??? // error // error
6
+
7
+ case _ : List [t2] | y2 => ??? // error // error
8
+
9
+ case x3 : Int | y3 : String => ??? // error // error
10
+
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments