question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unhelpful error message for ValueOf[N] when no singleton available for N (bounded by singleton)

See original GitHub issue

Compiler 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:closed
  • Created a year ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
som-snyttcommented, Sep 6, 2022

I think I tried to make implicitNotFound show an addendum; maybe that was for overrides?

https://github.com/scala/scala/pull/8280

1reaction
SethTisuecommented, Sep 6, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found