-
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 eta expand at erasure to take erased CFTs into account
- Loading branch information
Showing
12 changed files
with
154 additions
and
99 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
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
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,53 @@ | ||
import language.experimental.erasedDefinitions | ||
|
||
erased class CanThrow[-E <: Exception] | ||
erased class Foo | ||
class Bar | ||
|
||
object unsafeExceptions: | ||
given canThrowAny: CanThrow[Exception] = null | ||
|
||
object test1: | ||
trait Decoder[+T]: | ||
def apply(): T | ||
|
||
def deco: Decoder[CanThrow[Exception] ?=> Int] = new Decoder[CanThrow[Exception] ?=> Int]: | ||
def apply(): CanThrow[Exception] ?=> Int = 1 | ||
|
||
object test2: | ||
trait Decoder[+T]: | ||
def apply(): T | ||
|
||
def deco: Decoder[(CanThrow[Exception], Foo) ?=> Int] = new Decoder[(CanThrow[Exception], Foo) ?=> Int]: | ||
def apply(): (CanThrow[Exception], Foo) ?=> Int = 1 | ||
|
||
object test3: | ||
trait Decoder[+T]: | ||
def apply(): T | ||
|
||
def deco: Decoder[CanThrow[Exception] ?=> Foo ?=> Int] = new Decoder[CanThrow[Exception] ?=> Foo ?=> Int]: | ||
def apply(): CanThrow[Exception] ?=> Foo ?=> Int = 1 | ||
|
||
object test4: | ||
trait Decoder[+T]: | ||
def apply(): T | ||
|
||
def deco: Decoder[CanThrow[Exception] ?=> Bar ?=> Int] = new Decoder[CanThrow[Exception] ?=> Bar ?=> Int]: | ||
def apply(): CanThrow[Exception] ?=> Bar ?=> Int = 1 | ||
|
||
object test5: | ||
trait Decoder[+T]: | ||
def apply(): T | ||
|
||
def deco: Decoder[Bar ?=> CanThrow[Exception] ?=> Int] = new Decoder[Bar ?=> CanThrow[Exception] ?=> Int]: | ||
def apply(): Bar ?=> CanThrow[Exception] ?=> Int = 1 | ||
|
||
@main def Test(): Unit = | ||
import unsafeExceptions.canThrowAny | ||
given Foo = ??? | ||
given Bar = Bar() | ||
test1.deco.apply().apply | ||
test2.deco.apply().apply | ||
test3.deco.apply().apply | ||
test4.deco.apply().apply | ||
test5.deco.apply().apply |
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,11 @@ | ||
import language.experimental.saferExceptions | ||
|
||
trait Decoder[+T]: | ||
def apply(): T | ||
|
||
given Decoder[Int throws Exception] = new Decoder[Int throws Exception]: | ||
def apply(): Int throws Exception = 1 | ||
|
||
@main def Test(): Unit = | ||
import unsafeExceptions.canThrowAny | ||
summon[Decoder[Int throws Exception]]() |