Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10645 from som-snytt/issue/12690-import-commit
Track import selector of implicit info in search
- Loading branch information
Showing
11 changed files
with
92 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
t12690.scala:10: warning: Unused import | ||
import A._ // missing unused warning (order of imports is significant) | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
1 warning | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
//> using options -Werror -Wunused:imports | ||
|
||
class X | ||
class Y extends X | ||
object A { implicit val x: X = new X } | ||
object B { implicit val y: Y = new Y } | ||
class C { | ||
import B._ | ||
import A._ // missing unused warning (order of imports is significant) | ||
def t = implicitly[X] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
t12690b.scala:15: error: reference to v is ambiguous; | ||
it is imported twice in the same scope by | ||
import Y.v | ||
and import X.v | ||
v | ||
^ | ||
t12690b.scala:11: warning: Unused import | ||
import X.v | ||
^ | ||
t12690b.scala:12: warning: Unused import | ||
import Y.v | ||
^ | ||
2 warnings | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
// scalac: -Wunused:imports -Werror | ||
|
||
object X { | ||
val v = 27 | ||
} | ||
object Y { | ||
val v = 42 | ||
} | ||
object Main { | ||
import X.v | ||
import Y.v | ||
def main(args: Array[String]) = println { | ||
//"hello, world" | ||
v | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// scalac: -Werror -Wunused:imports | ||
|
||
import language._ | ||
|
||
|