-
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.
Only allow erased parameters in erased definitions
So far, we do not have any use case for them. We could enable them in a later version. The current implementation does not handle correctly the non-erased arguments to erased definitions. These should always be evaluated, but in some cases we can dorp them by mistake.
- Loading branch information
1 parent
adf089b
commit d335e93
Showing
8 changed files
with
53 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import scala.language.experimental.erasedDefinitions | ||
|
||
erased def test1(x: Int): Int = x // error | ||
erased def test2(erased x: Int): Int = x | ||
erased def test3(erased x: Int, erased y: Int): Int = x | ||
erased def test4(erased x: Int, y: Int): Int = x // error | ||
erased def test5(x: Int, erased y: Int): Int = y // error | ||
erased def test6(x: Int, y: Int): Int = y // error // error | ||
erased def test7(erased x: Int)(erased y: Int): Int = x | ||
erased def test8(erased x: Int)(y: Int): Int = x // error | ||
erased def test9(x: Int)(erased y: Int): Int = y // error | ||
erased def test10(x: Int)(y: Int): Int = y // error // error |