newtype extending newtype when underlying values extend eachother?
See original GitHub issueGiven:
trait Foo
trait Bar extends Foo
why wouldn’t
@newtype class NFoo(val internal: Foo)
@newtype class NBar(override val internal: Bar) extends NFoo(internal)
be valid?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Extending the Type System - Polyglot Tutorial
Every interface defining a type and its operations ultimately extends Type . ... Typically, a new type class can be defined by extending...
Read more >https://svn.python.org/projects/python/branches/re...
This is not hard; the code for all extension types follows a pattern, ... So, if you want to define a new object...
Read more >Possible to extend types in Typescript? - Stack Overflow
UPDATE for TypeScript 2.2, it's now possible to have an interface that extends object-like type, if the type satisfies some restrictions:
Read more >Chapter 6. Using Typeclasses - Real World Haskell
Typeclasses are at the heart of some basic language features such as equality ... As with the data keyword, we can use a...
Read more >Extending the model · Backstage Software Catalog and ...
Adding a new type takes relatively little effort and carries little risk. Any type value is accepted by the catalog backend, but plugins...
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
Here’s how it might be expanded:
My only worry is the
internal
s conflicting; depending on how implicit priority works,NBar.Ops$newtype
should take priority overNFoo.Ops$newtype
.I think so; try adding the
<: Foo
bound on my previous example -