-
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.
Check that overrides don't change the @unbox status of their parameters
- Loading branch information
Showing
4 changed files
with
55 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
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,21 @@ | ||
-- [E164] Declaration Error: tests/neg-custom-args/captures/unbox-overrides.scala:8:6 ---------------------------------- | ||
8 | def foo(x: C): C // error | ||
| ^ | ||
|error overriding method foo in trait A of type (x: C): C; | ||
| method foo of type (x: C): C has a parameter x with different @unbox status than the corresponding parameter in the overridden definition | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E164] Declaration Error: tests/neg-custom-args/captures/unbox-overrides.scala:9:6 ---------------------------------- | ||
9 | def bar(@unbox x: C): C // error | ||
| ^ | ||
|error overriding method bar in trait A of type (x: C): C; | ||
| method bar of type (x: C): C has a parameter x with different @unbox status than the corresponding parameter in the overridden definition | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E164] Declaration Error: tests/neg-custom-args/captures/unbox-overrides.scala:15:15 -------------------------------- | ||
15 |abstract class C extends A[C], B2 // error | ||
| ^ | ||
|error overriding method foo in trait A of type (x: C): C; | ||
| method foo in trait B2 of type (x: C): C has a parameter x with different @unbox status than the corresponding parameter in the overridden definition | ||
| | ||
| 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 @@ | ||
import caps.unbox | ||
|
||
trait A[X]: | ||
def foo(@unbox x: X): X | ||
def bar(x: X): X | ||
|
||
trait B extends A[C]: | ||
def foo(x: C): C // error | ||
def bar(@unbox x: C): C // error | ||
|
||
trait B2: | ||
def foo(x: C): C | ||
def bar(@unbox x: C): C | ||
|
||
abstract class C extends A[C], B2 // error |