Skip to content

Do not print trailing spaces on suggestions #8999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ trait ImportSuggestions:
|$fix might $help the problem:
|
|$suggestions%\n%
"""
|
|"""
end importSuggestionAddendum
end ImportSuggestions
10 changes: 5 additions & 5 deletions tests/neg/missing-implicit.check
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
|
| import math.Ordered.orderingToOrdered
| import math.Ordering.Implicits.infixOrderingOps
|
|
-- [E008] Not Found Error: tests/neg/missing-implicit.scala:5:51 -------------------------------------------------------
5 | case x :: xs1 if limit > 0 => consume(xs1, limit - x) // error // error
| ^^^^^^^
Expand All @@ -16,7 +16,7 @@
| The following import might fix the problem:
|
| import math.Numeric.Implicits.infixNumericOps
|
|
-- Error: tests/neg/missing-implicit.scala:10:24 -----------------------------------------------------------------------
10 |val f = Future[Unit] { } // error
| ^
Expand All @@ -36,7 +36,7 @@
| The following import might fix the problem:
|
| import concurrent.ExecutionContext.Implicits.global
|
|
-- [E007] Type Mismatch Error: tests/neg/missing-implicit.scala:12:25 --------------------------------------------------
12 |val b: java.lang.Byte = (1: Byte) // error, but no hint
| ^^^^^^^
Expand All @@ -58,7 +58,7 @@
| The following import might fix the problem:
|
| import concurrent.duration.pairIntToDuration
|
|
-- [E008] Not Found Error: tests/neg/missing-implicit.scala:18:48 ------------------------------------------------------
18 |val d2: scala.concurrent.duration.Duration = 10.days // error
| ^^^^^^^
Expand All @@ -69,4 +69,4 @@
| import concurrent.duration.DurationInt
| import concurrent.duration.DurationLong
| import concurrent.duration.DurationDouble
|
|
16 changes: 8 additions & 8 deletions tests/neg/missing-implicit1.check
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
|The following import might fix the problem:
|
| import testObjectInstance.instances.zipOption
|
|
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:19:16 -----------------------------------------------------
19 | List(1, 2, 3).traverse(x => Option(x)) // error
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -15,7 +15,7 @@
| The following import might make progress towards fixing the problem:
|
| import testObjectInstance.instances.traverseList
|
|
-- Error: tests/neg/missing-implicit1.scala:23:42 ----------------------------------------------------------------------
23 | List(1, 2, 3).traverse(x => Option(x)) // error
| ^
Expand All @@ -24,7 +24,7 @@
|The following import might fix the problem:
|
| import testObjectInstance.instances.zipOption
|
|
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:26:16 -----------------------------------------------------
26 | List(1, 2, 3).first // error
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -33,7 +33,7 @@
| The following import might fix the problem:
|
| import testObjectInstance.instances.first
|
|
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:27:16 -----------------------------------------------------
27 | List(1, 2, 3).second // error
| ^^^^^^^^^^^^^^^^^^^^
Expand All @@ -42,7 +42,7 @@
| The following import might fix the problem:
|
| import testObjectInstance.instances.listExtension
|
|
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:28:17 -----------------------------------------------------
28 | Array(1, 2, 3).first // error, no hint
| ^^^^^^^^^^^^^^^^^^^^
Expand All @@ -55,7 +55,7 @@
| The following import might fix the problem:
|
| import instances.zipOption
|
|
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:46:16 -----------------------------------------------------
46 | List(1, 2, 3).traverse(x => Option(x)) // error
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -64,7 +64,7 @@
| The following import might make progress towards fixing the problem:
|
| import instances.traverseList
|
|
-- Error: tests/neg/missing-implicit1.scala:50:42 ----------------------------------------------------------------------
50 | List(1, 2, 3).traverse(x => Option(x)) // error
| ^
Expand All @@ -73,4 +73,4 @@
|The following import might fix the problem:
|
| import instances.zipOption
|
|
4 changes: 2 additions & 2 deletions tests/neg/missing-implicit2.check
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| The following import might fix the problem:
|
| import test.instances.y
|
|
-- Error: tests/neg/missing-implicit2.scala:16:5 -----------------------------------------------------------------------
16 | f // error
| ^
Expand All @@ -15,4 +15,4 @@
| The following import might make progress towards fixing the problem:
|
| import instances2.xFromY
|
|