-
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.
Merge pull request #13655 from dotty-staging/lazy-list-essays
Include capture sets of methods in enclosing class
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
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,7 @@ | ||
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/nestedclass.scala:15:15 ---------------------------------- | ||
15 | val xsc: C = xs // error | ||
| ^^ | ||
| Found: (xs : {cap1} C) | ||
| Required: C | ||
|
||
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,15 @@ | ||
class CC | ||
type Cap = {*} CC | ||
|
||
abstract class C: | ||
def head: String | ||
|
||
def test(cap1: Cap, cap2: Cap) = | ||
def f(x: String): String = if cap1 == cap1 then "" else "a" | ||
def g(x: String): String = if cap2 == cap2 then "" else "a" | ||
|
||
val xs = | ||
class Cimpl extends C: | ||
def head = f("") | ||
new Cimpl | ||
val xsc: C = xs // error |