-
Notifications
You must be signed in to change notification settings - Fork 1.1k
NoType when deriving an abstract type #13808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have updated the code with the error shown in scala 3.1 |
minimised to being a plain abstract type: object FooModule:
type Foo[A]
object Foo:
def derived[A]: Foo[A] = Nil.asInstanceOf[Foo[A]]
import FooModule.Foo
case class Boom[A](value: A) derives Foo |
Wow, thanks for the quick response and fix! I take it from the new error message we're unable to use the derivation functionality with opaque types, so I'll have to use a wrapper type instead. Is there a reason this is unsound or is it just not possible? |
Nobody has thought through the ramifications of allowing something different than a class type. Also it would be irregular wrt to |
Thanks for the explanation. This is way above my pay grade so I'll create a feature request and leave it for more brilliant minds to decide if it's sound and worth implementing. |
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.1.0
Minimized code
Output
Expectation
compiles or provides more a useful error
In case it's not clear from the code, I'm trying to derive an instance of an opaque type.
The text was updated successfully, but these errors were encountered: