forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
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 scala#13812 from dotty-staging/fix-13808
Fix error message when deriving an obstract type
- Loading branch information
Showing
3 changed files
with
26 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,8 @@ | ||
-- Error: tests/neg/i13808.scala:13:37 --------------------------------------------------------------------------------- | ||
13 |case class Boom[A](value: A) derives OpaqueType, Foo // error // error | ||
| ^^^^^^^^^^ | ||
| OpaqueTypes.OpaqueType is not a class type | ||
-- Error: tests/neg/i13808.scala:13:49 --------------------------------------------------------------------------------- | ||
13 |case class Boom[A](value: A) derives OpaqueType, Foo // error // error | ||
| ^^^ | ||
| FooModule.Foo is not a class type |
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,14 @@ | ||
object OpaqueTypes: | ||
opaque type OpaqueType[A] = List[A] | ||
object OpaqueType: | ||
def derived[A]: OpaqueType[A] = Nil | ||
|
||
object FooModule: | ||
type Foo[A] | ||
object Foo: | ||
def derived[A]: Foo[A] = Nil.asInstanceOf[Foo[A]] | ||
|
||
import FooModule.Foo | ||
import OpaqueTypes.OpaqueType | ||
case class Boom[A](value: A) derives OpaqueType, Foo // error // error | ||
|