-
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.
Survive inaccessible types when computing implicit scope (#21589)
Also: Give a better error message later when encountering a missing type that refers to a private member of a base class. The previous one was misleading since it referred to a potentially missing class file, which is certainly not the case here. Fixes #21543
- Loading branch information
Showing
7 changed files
with
51 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-- [E007] Type Mismatch Error: tests/neg/i21543.scala:10:15 ------------------------------------------------------------ | ||
10 | Cmd(List("1", "2")) // error // error | ||
| ^^^ | ||
| Found: ("1" : String) | ||
| Required: Event | ||
| | ||
| Note that I could not resolve reference Event. | ||
| Event is a private member in a base class | ||
| | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E007] Type Mismatch Error: tests/neg/i21543.scala:10:20 ------------------------------------------------------------ | ||
10 | Cmd(List("1", "2")) // error // error | ||
| ^^^ | ||
| Found: ("2" : String) | ||
| Required: Event | ||
| | ||
| Note that I could not resolve reference Event. | ||
| Event is a private member in a base class | ||
| | ||
| | ||
| 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,13 @@ | ||
object CompilerCrash { | ||
trait Scope { | ||
private type Event = String | ||
|
||
case class Cmd(events: List[Event]) | ||
} | ||
|
||
new Scope { | ||
val commands = List( | ||
Cmd(List("1", "2")) // error // error | ||
) | ||
} | ||
} |