unhelpful error message for ValueOf[N] when no singleton available for N (bounded by singleton)
See original GitHub issueCompiler version
3.2.0-RC1
Minimized code
import scala.compiletime.*
class Vec[N <: Int & Singleton] :
private val xs: Array[Double] = Array.ofDim[Double](summon[ValueOf[N]].value)
Output
No singleton value available for N.
Expectation
My expectation is that the Singleton
bound makes ValueOf
realize that N
is a singleton. But I am no expert, and the fact that https://github.com/lampepfl/dotty/issues/8257 was closed makes me wonder. But then my expectation would be to get an error message that is clearer.
A bit more detail at https://users.scala-lang.org/t/how-do-i-compute-type-level-m-n/8715/2
Issue Analytics
- State:
- Created a year ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
"No singleton value available for A" when A is clearly a singleton
I can't figure out why this code wouldn't compile and fail with a: No singleton value available for A where: A is a...
Read more >Dependently typed programming with singletons
First, the dictionary for SingI n must be available at runtime, and the value of n—a type—is erased at compile time. Second, the...
Read more >Duplicate error when using abstract, singleton, class << self ...
Sometimes I look at my issue titles and think "what in the world kind of nonsense is this" and this is definitely one...
Read more >Singletons - drive5
A singleton is a read with a sequence that is present exactly once, i.e. is unique among the reads. Singletons should be discarded....
Read more >arXiv:2205.14655v1 [cs.IT] 29 May 2022 Network Decoding
Abstract. We consider the problem of error control in a coded, multicast network, focusing on the scenario where the errors can occur only ......
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
I think I tried to make
implicitNotFound
show an addendum; maybe that was for overrides?https://github.com/scala/scala/pull/8280
There’s a broader design question here, which is: when a custom
implicitNotFound
message is available, perhaps it would be nicer if the compiler showed both the custom message, and the more general message that indicates that implicit search failed, and what type is what looking for?