Mirror.SumOf not being provided when 0 inhabitants
See original GitHub issueCompiler version
3.0.0-RC1
Minimized code
import scala.deriving.*
sealed trait X
summon[Mirror.Of[X]]
Output
[error] 59 | summon[Mirror.Of[X]]
[error] | ^
[error] |no implicit argument of type deriving.Mirror.Of[X] was found for parameter x of method summon in object Predef
Expectation
X is a sealed trait. I expect a Mirror.SumOf[X] { type MirroredElemTypes = EmptyTuple }
to be provided.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:17 (12 by maintainers)
Top Results From Across the Web
Divisibility of the sum of a number and its 'mirror'
No, I think you are misunderstanding the solution. The overbar notation in context seems to be this author's way of denoting a multidigit ......
Read more >6A characterizing data Flashcards - Quizlet
Study with Quizlet and memorize flashcards containing terms like what is the mean, what is the median, what is the mode and more....
Read more >Type Class Derivation Does Not Work With Contravariant Types
no implicit argument of type deriving.Mirror.Of[T] was found for parameter m of given instance derived in object Eq where: T is a type ......
Read more >Standards and Guidelines for Statistical Surveys - SAMHSA
Standard 1.2: Agencies must develop a survey design, including defining the target population, designing the sampling plan, specifying the data collection ...
Read more >Mean number of Decayed, Missing, and Filled Permanent ...
DMFT is the sum of the number of Decayed, Missing due to caries, and Filled ... 0: Sound - A crown/root is coded...
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 Free
Top 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
An example would be, “Fool me once, shame on you. Fool me twice, shame on me.” There is no fool me zeroth. I guess we are always already fooled, which sounds about right to me.
Hello. As I understand it, which ever library you’re talking about currently doesn’t support sum types with no inhabitants (both because Scala 3 isn’t providing a mirror and because they’ve used
reduce
instead offoldLeft
), so fixing up the Scala 3 side of the equation will result in it going from “not working” (via compilation error due to no implicit mirror) to “not working” (due to a crash). This doesn’t seem like a great reason to hold back the entire language. If it didn’t work before and wont work immediately after this change, we’re not breaking anything, we’re just discussing what the break looks like.I really think we should add this to a minor release. That some library used
reduce
instead offoldLeft
shouldn’t hold back Scala itself. Plus it would be trivial to fix such a library, no? 0 inhabitants isn’t some special case here, it’s just a natural part of the mathematics. Expecting at least one inhabitant is the artificial special case here.