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 #10447 from som-snytt/issue/12813
Nuance import selector errors in Namers
- Loading branch information
Showing
13 changed files
with
135 additions
and
73 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
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,16 @@ | ||
t12813.scala:5: error: a is imported twice | ||
import O.{a, a} // error | ||
^ | ||
t12813.scala:8: error: b is an ambiguous name on import | ||
import O.{a => b, a => b} // error | ||
^ | ||
t12813.scala:10: error: b is an ambiguous name on import | ||
import O.{a => b, toString => b} // error | ||
^ | ||
t12813.scala:11: error: toString is an ambiguous name on import | ||
import O.{a => toString, toString} // error | ||
^ | ||
t12813.scala:12: error: toString is an ambiguous name on import | ||
import O.{toString, a => toString} // error | ||
^ | ||
5 errors |
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,19 @@ | ||
// | ||
|
||
object O { val a = 1 } | ||
|
||
import O.{a, a} // error | ||
import O.{a => b, a} // ok | ||
import O.{a, a => b} // ok | ||
import O.{a => b, a => b} // error | ||
import O.{a => b, a => c} // ok | ||
import O.{a => b, toString => b} // error | ||
import O.{a => toString, toString} // error | ||
import O.{toString, a => toString} // error | ||
import O.{a => _, toString => _} // ok | ||
import O.{given, a, _} // ok | ||
import O.{given, toString, a, _} // ok | ||
import O.{a, given, *} // ok | ||
import O.{a, *, given} // ok | ||
import O.{a, given, *, _} // ok | ||
import O.{a, given} // ok |
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,28 @@ | ||
t12813b.scala:5: error: a is imported twice | ||
import O.{a, a} // error | ||
^ | ||
t12813b.scala:8: error: b is an ambiguous name on import | ||
import O.{a => b, a => b} // error | ||
^ | ||
t12813b.scala:10: error: b is an ambiguous name on import | ||
import O.{a => b, toString => b} // error | ||
^ | ||
t12813b.scala:11: error: toString is an ambiguous name on import | ||
import O.{a => toString, toString} // error | ||
^ | ||
t12813b.scala:12: error: toString is an ambiguous name on import | ||
import O.{toString, a => toString} // error | ||
^ | ||
t12813b.scala:14: error: wildcard import must be in last position | ||
import O.{given, a, _} // error 3 | ||
^ | ||
t12813b.scala:15: error: wildcard import must be in last position | ||
import O.{given, toString, a, _} // error 3 | ||
^ | ||
t12813b.scala:18: error: duplicate wildcard selector | ||
import O.{a, given, *, _} // error 3 | ||
^ | ||
t12813b.scala:19: error: given requires a wildcard selector | ||
import O.{a, given} // error 3 | ||
^ | ||
9 errors |
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,19 @@ | ||
// scalac: -Xsource:3 | ||
|
||
object O { val a = 1 } | ||
|
||
import O.{a, a} // error | ||
import O.{a => b, a} // ok | ||
import O.{a, a => b} // ok | ||
import O.{a => b, a => b} // error | ||
import O.{a => b, a => c} // ok | ||
import O.{a => b, toString => b} // error | ||
import O.{a => toString, toString} // error | ||
import O.{toString, a => toString} // error | ||
import O.{a => _, toString => _} // ok | ||
import O.{given, a, _} // error 3 | ||
import O.{given, toString, a, _} // error 3 | ||
import O.{a, given, *} // ok | ||
import O.{a, *, given} // ok | ||
import O.{a, given, *, _} // error 3 | ||
import O.{a, given} // error 3 |
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,4 +1,4 @@ | ||
// scalac: -Xlint -Xfatal-warnings | ||
// scalac: -Werror -Xlint | ||
// | ||
|
||
import java.io._ | ||
|
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