-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #997 #1066
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
Merged
Fix #997 #1066
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6a93dd0
Copy access flags to derived definitions during desugaring
odersky eb1908a
New utility method: Reporter#errorOrMigrationWarning
odersky fc043bf
Add checking for leaking private definitions
odersky 19026b8
Fix two private leaks in dotty compiler itself.
odersky 5470290
Move leak detection to Checking
odersky 5969e02
Fix expected error count
odersky 97e261d
Merge parentsWithArgs and instantiatedParents
odersky 6f382a5
Add error markers
odersky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,47 @@ | ||
class C { | ||
|
||
private type T = E | ||
private type Tok = D | ||
private val p: C = new C | ||
|
||
def f1(x: T): Unit = () // error | ||
def f1(x: Tok): Unit = () // ok | ||
def f2(x: p.D): Unit = () // error | ||
|
||
val v1: T = ??? // error | ||
val v2: p.D = ??? // error | ||
|
||
type U1[X <: T] // error | ||
type U2 = T // error | ||
|
||
private class E { | ||
def f1ok(x: T): Unit = () // ok | ||
def f2ok(x: p.D): Unit = () // ok | ||
|
||
val v1ok: T = ??? // ok | ||
val v2ok: p.D = ??? // ok | ||
|
||
type U1ok[X <: T] //ok | ||
type U2ok = T //ok | ||
} | ||
|
||
class D extends E { // error | ||
def f1(x: T): Unit = () // error | ||
def f2(x: p.D): Unit = () // error | ||
|
||
val v1: T = ??? // error | ||
val v2: p.D = ??? // error | ||
|
||
type U1[X <: T] // error | ||
type U2 = T // error | ||
} | ||
|
||
class F(x: T) // error | ||
|
||
class G private (x: T) // ok | ||
|
||
private trait U | ||
|
||
class H extends U // error | ||
|
||
} |
This file contains hidden or 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 @@ | ||
class C { | ||
|
||
class Super | ||
|
||
object O { | ||
|
||
private case class CC(x: Int) | ||
|
||
private implicit class D(x: Int) extends Super | ||
} | ||
|
||
import O._ | ||
|
||
println(O.CC(1)) // error: CC cannot be accessed | ||
|
||
val s: Super = 1 // error: type mismatch | ||
|
||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just call
ctx.errorOrMigrationWarning
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we might end up not issuing the error if a parent is a TypeAlias.