forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
53 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import caps.* | ||
|
||
trait AbstractWrong: | ||
type C <: CapSet | ||
def boom(): Unit^{C^} // error | ||
type C <: CapSet | ||
def f(): Unit^{C^} // error | ||
|
||
trait Abstract: | ||
type C <: CapSet^ | ||
def boom(): Unit^{C^} | ||
|
||
class Concrete extends Abstract: | ||
type C = Nothing | ||
def boom() = () // error | ||
trait Abstract1: | ||
type C^ | ||
def f(): Unit^{C^} | ||
|
||
class Abstract2: | ||
type C >: CapSet <: CapSet^ | ||
def f(): Unit^{C^} |
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,33 @@ | ||
import caps.* | ||
|
||
class IO | ||
|
||
class File | ||
|
||
trait Abstract: | ||
type C >: CapSet <: CapSet^ | ||
def f(file: File^{C^}): Unit | ||
|
||
class Concrete1 extends Abstract: | ||
type C = CapSet | ||
def f(file: File) = () | ||
|
||
class Concrete2(io: IO^) extends Abstract: | ||
type C = CapSet^{io} | ||
def f(file: File^{io}) = () | ||
|
||
class Concrete3(io: IO^) extends Abstract: | ||
type C = CapSet^{io} | ||
def f(file: File) = () // error | ||
|
||
trait Abstract2(io: IO^): | ||
type C >: CapSet <: CapSet^{io} | ||
def f(file: File^{C^}): Unit | ||
|
||
class Concrete4(io: IO^) extends Abstract2(io): | ||
type C = CapSet | ||
def f(file: File) = () | ||
|
||
class Concrete5(io1: IO^, io2: IO^) extends Abstract2(io1): | ||
type C = CapSet^{io2} // error | ||
def f(file: File^{io2}) = () |
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