Skip to content

Commit db4be22

Browse files
Merge pull request #8999 from dotty-staging/do-not-print-trailing-spaces-on-suggestion
Do not print trailing spaces on suggestions
2 parents c1a9ce3 + 1bb21e0 commit db4be22

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ trait ImportSuggestions:
323323
|$fix might $help the problem:
324324
|
325325
|$suggestions%\n%
326-
"""
326+
|
327+
|"""
327328
end importSuggestionAddendum
328329
end ImportSuggestions

tests/neg/missing-implicit.check

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|
88
| import math.Ordered.orderingToOrdered
99
| import math.Ordering.Implicits.infixOrderingOps
10-
|
10+
|
1111
-- [E008] Not Found Error: tests/neg/missing-implicit.scala:5:51 -------------------------------------------------------
1212
5 | case x :: xs1 if limit > 0 => consume(xs1, limit - x) // error // error
1313
| ^^^^^^^
@@ -16,7 +16,7 @@
1616
| The following import might fix the problem:
1717
|
1818
| import math.Numeric.Implicits.infixNumericOps
19-
|
19+
|
2020
-- Error: tests/neg/missing-implicit.scala:10:24 -----------------------------------------------------------------------
2121
10 |val f = Future[Unit] { } // error
2222
| ^
@@ -36,7 +36,7 @@
3636
| The following import might fix the problem:
3737
|
3838
| import concurrent.ExecutionContext.Implicits.global
39-
|
39+
|
4040
-- [E007] Type Mismatch Error: tests/neg/missing-implicit.scala:12:25 --------------------------------------------------
4141
12 |val b: java.lang.Byte = (1: Byte) // error, but no hint
4242
| ^^^^^^^
@@ -58,7 +58,7 @@
5858
| The following import might fix the problem:
5959
|
6060
| import concurrent.duration.pairIntToDuration
61-
|
61+
|
6262
-- [E008] Not Found Error: tests/neg/missing-implicit.scala:18:48 ------------------------------------------------------
6363
18 |val d2: scala.concurrent.duration.Duration = 10.days // error
6464
| ^^^^^^^
@@ -69,4 +69,4 @@
6969
| import concurrent.duration.DurationInt
7070
| import concurrent.duration.DurationLong
7171
| import concurrent.duration.DurationDouble
72-
|
72+
|

tests/neg/missing-implicit1.check

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
|The following import might fix the problem:
77
|
88
| import testObjectInstance.instances.zipOption
9-
|
9+
|
1010
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:19:16 -----------------------------------------------------
1111
19 | List(1, 2, 3).traverse(x => Option(x)) // error
1212
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@
1515
| The following import might make progress towards fixing the problem:
1616
|
1717
| import testObjectInstance.instances.traverseList
18-
|
18+
|
1919
-- Error: tests/neg/missing-implicit1.scala:23:42 ----------------------------------------------------------------------
2020
23 | List(1, 2, 3).traverse(x => Option(x)) // error
2121
| ^
@@ -24,7 +24,7 @@
2424
|The following import might fix the problem:
2525
|
2626
| import testObjectInstance.instances.zipOption
27-
|
27+
|
2828
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:26:16 -----------------------------------------------------
2929
26 | List(1, 2, 3).first // error
3030
| ^^^^^^^^^^^^^^^^^^^
@@ -33,7 +33,7 @@
3333
| The following import might fix the problem:
3434
|
3535
| import testObjectInstance.instances.first
36-
|
36+
|
3737
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:27:16 -----------------------------------------------------
3838
27 | List(1, 2, 3).second // error
3939
| ^^^^^^^^^^^^^^^^^^^^
@@ -42,7 +42,7 @@
4242
| The following import might fix the problem:
4343
|
4444
| import testObjectInstance.instances.listExtension
45-
|
45+
|
4646
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:28:17 -----------------------------------------------------
4747
28 | Array(1, 2, 3).first // error, no hint
4848
| ^^^^^^^^^^^^^^^^^^^^
@@ -55,7 +55,7 @@
5555
| The following import might fix the problem:
5656
|
5757
| import instances.zipOption
58-
|
58+
|
5959
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:46:16 -----------------------------------------------------
6060
46 | List(1, 2, 3).traverse(x => Option(x)) // error
6161
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -64,7 +64,7 @@
6464
| The following import might make progress towards fixing the problem:
6565
|
6666
| import instances.traverseList
67-
|
67+
|
6868
-- Error: tests/neg/missing-implicit1.scala:50:42 ----------------------------------------------------------------------
6969
50 | List(1, 2, 3).traverse(x => Option(x)) // error
7070
| ^
@@ -73,4 +73,4 @@
7373
|The following import might fix the problem:
7474
|
7575
| import instances.zipOption
76-
|
76+
|

tests/neg/missing-implicit2.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| The following import might fix the problem:
77
|
88
| import test.instances.y
9-
|
9+
|
1010
-- Error: tests/neg/missing-implicit2.scala:16:5 -----------------------------------------------------------------------
1111
16 | f // error
1212
| ^
@@ -15,4 +15,4 @@
1515
| The following import might make progress towards fixing the problem:
1616
|
1717
| import instances2.xFromY
18-
|
18+
|

0 commit comments

Comments
 (0)