-
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 logic when comparing var/def bindings with val refinements
We always widened def to val, which means it made no difference in a comparison { val/var/def x: T } <: { val/def x: T} which kinds the bindings were. That clearly overlooks something important.
- Loading branch information
Showing
7 changed files
with
59 additions
and
19 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,15 @@ | ||
def foo(x: Any { def foo: Int }): Any { val foo: Int } = x // error | ||
def foo1(x: Any { val foo: Int }): Any { def foo: Int } = x // ok | ||
def foo2(x: Any { val foo: Int }): Any { val foo: Int } = x // ok | ||
def foo3(x: Any { def foo: Int }): Any { def foo: Int } = x // ok | ||
|
||
class Foo: | ||
val foo: Int = 1 | ||
class Foo1: | ||
def foo: Int = 1 | ||
class Foo2: | ||
var foo: Int = 1 | ||
|
||
def foo4(x: Foo): Any { val foo: Int } = x // ok | ||
def foo4(x: Foo1): Any { val foo: Int } = x // error | ||
def foo4(x: Foo2): Any { val foo: Int } = x // error |
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