-
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.
Fix enclosingClass from returning refinement classes (#21411)
- Loading branch information
Showing
4 changed files
with
28 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package object packer: // the super class needs to be in a different package | ||
class SuperClass(): | ||
protected val problem: Any = ??? // needs to be protected | ||
|
||
class SuperClass(): | ||
protected val problem: Any = ??? // needs to be protected | ||
|
||
// type Target = SuperClass // passes | ||
type Target = packer.SuperClass // error | ||
|
||
trait Child extends Target: | ||
|
||
val aliased: problem.type = problem | ||
type Alias = problem.type | ||
|
||
val newProblem: Any {val prog: problem.type} = ??? // error | ||
val newProblem2: Any {val prog: Alias} = ??? // passes | ||
val newProblem3: Any {val prog: aliased.type} = ??? // passes | ||
|
||
class ChildImpl extends Target with Child // concrete implementation is needed |