File tree 3 files changed +11
-1
lines changed
compiler/src/dotty/tools/dotc/typer 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1360,7 +1360,7 @@ trait Applications extends Compatibility {
1360
1360
for (argType <- argTypes) assert(! isBounds(argType), unapplyApp.tpe.show)
1361
1361
val bunchedArgs = argTypes match {
1362
1362
case argType :: Nil =>
1363
- if (args.lengthCompare(1 ) > 0 && Feature .autoTuplingEnabled) untpd.Tuple (args) :: Nil
1363
+ if (args.lengthCompare(1 ) > 0 && Feature .autoTuplingEnabled && defn.isTupleType(argType) ) untpd.Tuple (args) :: Nil
1364
1364
else args
1365
1365
case _ => args
1366
1366
}
Original file line number Diff line number Diff line change
1
+ -- [E107] Syntax Error: tests/neg/i10757.scala:4:10 --------------------------------------------------------------------
2
+ 4 | case Var(name, _) => name: String // error
3
+ | ^^^^^^^^^^^^
4
+ | Wrong number of argument patterns for Var; expected: (String)
5
+
6
+ longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
1
+ case class Var (name : String )
2
+
3
+ @ main def f = Var (" a" ) match
4
+ case Var (name, _) => name : String // error
You can’t perform that action at this time.
0 commit comments