File tree 2 files changed +10
-9
lines changed
compiler/src/dotty/tools/dotc/ast
tests/neg-custom-args/captures
2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -1656,7 +1656,7 @@ object desugar {
1656
1656
val sel = Select (fn, op.name).withSpan(selectPos)
1657
1657
if (left.sourcePos.endLine < op.sourcePos.startLine)
1658
1658
sel.pushAttachment(MultiLineInfix , ())
1659
- arg match
1659
+ val apply = arg match
1660
1660
case Parens (arg) =>
1661
1661
Apply (sel, assignToNamedArg(arg) :: Nil )
1662
1662
case Tuple (args) if args.exists(_.isInstanceOf [Assign ]) =>
@@ -1665,6 +1665,7 @@ object desugar {
1665
1665
Apply (sel, arg :: Nil ).setApplyKind(ApplyKind .InfixTuple )
1666
1666
case _ =>
1667
1667
Apply (sel, arg :: Nil )
1668
+ apply.withSpan(apply.span.union(arg.span))
1668
1669
1669
1670
if op.name.isRightAssocOperatorName then
1670
1671
makeOp(right, left, Span (op.span.start, right.span.end))
Original file line number Diff line number Diff line change 1
1
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:22:11 --------------------------------------
2
2
22 | cur = (() => f.write()) :: Nil // error
3
- | ^^^^^^^^^^^^^^^^^^^^^^^
4
- | Found: List[box () ->{f} Unit]
5
- | Required: List[box () ->{xs*} Unit]
3
+ | ^ ^^^^^^^^^^^^^^^^^^^^^^^
4
+ | Found: List[box () ->{f} Unit]
5
+ | Required: List[box () ->{xs*} Unit]
6
6
|
7
7
| longer explanation available when compiling with `-explain`
8
8
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:33:7 ---------------------------------------
9
9
33 | (() => f.write()) :: Nil // error
10
- | ^^^^^^^^^^^^^^^^^^^^^^^
11
- | Found: List[box () ->{f} Unit]
12
- | Required: box List[box () ->{xs*} Unit]^?
10
+ | ^ ^^^^^^^^^^^^^^^^^^^^^^^
11
+ | Found: List[box () ->{f} Unit]
12
+ | Required: box List[box () ->{xs*} Unit]^?
13
13
|
14
- | Note that reference (f : File^), defined in method $anonfun
15
- | cannot be included in outer capture set {xs*} of value cur
14
+ | Note that reference (f : File^), defined in method $anonfun
15
+ | cannot be included in outer capture set {xs*} of value cur
16
16
|
17
17
| longer explanation available when compiling with `-explain`
18
18
-- Error: tests/neg-custom-args/captures/reaches.scala:36:6 ------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments