-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-use attachment in exportForwarders to handle ambiguous overloads
exportForwarders can be called more than once for the same expression if there are ambiguous overloads. Just return the already computed ExportForwarders if that happens. Closes #21071
- Loading branch information
Showing
3 changed files
with
35 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- [E051] Reference Error: tests/neg/i21071.scala:9:2 ------------------------------------------------------------------ | ||
9 | foo { // error | ||
| ^^^ | ||
| Ambiguous overload. The overloaded alternatives of method foo in object MySuite with types | ||
| (a: String): Nothing | ||
| (a: List[String]): Nothing | ||
| both match arguments ((??? : => Nothing)) | ||
| | ||
| longer explanation available when compiling with `-explain` |
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,21 @@ | ||
trait Service { | ||
def method: String | ||
} | ||
|
||
object MySuite { | ||
def foo(a: List[String]) = ??? | ||
def foo(a: String) = ??? | ||
|
||
foo { // error | ||
|
||
new Service { | ||
private val underlying: Service = ??? | ||
private val s = "foo" | ||
|
||
export underlying.* | ||
export s.toLowerCase | ||
} | ||
|
||
??? | ||
} | ||
} |