NoType when deriving an abstract type
See original GitHub issueCompiler version
3.1.0
Minimized code
object OpaqueTypes:
opaque type OpaqueType[A] = List[A]
object OpaqueType:
def derived[A]: OpaqueType[A] = Nil
import OpaqueTypes.OpaqueType
case class Boom[A](value: A) derives OpaqueType
Output
-- Error: foo.scala:7:37 -------------------------------------------------------
7 |case class Boom[A](value: A) derives OpaqueType
| ^^^^^^^^^^
| <notype> is not a class type
1 error found
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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TypeScript Abstract Class
Define an abstract class in Typescript using the abstract keyword. Abstract classes are mainly for inheritance where other classes may derive from them....
Read more >Abstract Base class in Python
An abstract class is designed only to act as a base class (to be inherited by other classes). It is a design concept...
Read more >c# - Can't cast derived type to base abstract class with ...
If the concrete classes inherit from a common abstract base class with a type parameter I cannot cast them. The compiler tells me...
Read more >abstract - C# Reference
A non-abstract class derived from an abstract class must include actual implementations of all inherited abstract methods and accessors.
Read more >What is the purpose of an abstract class in object-oriented ...
The Person class is too ambiguous in itself, so you make it abstract. Abstract classes can include logic, and enforce subclass (derived objects)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
minimised to being a plain abstract type:
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.