Skip to content

“No singleton value available for A” where A is clearly a singleton #12583

Closed
@epifab

Description

@epifab

Compiler version

3.0.0

Minimized code

case class Wrapper[A <: Singleton](a: A)(using ValueOf[A])

def test[A <: Singleton](blabla: Wrapper[A]): Unit = ()

test(Wrapper("yo"))

Output

No singleton value available for A
where: A is a type variable with constraint >: ("yo" : String) and <: Singleton

Expectation

It looks like the compiler could infer the right type for A ("yo": String) but then it can't find a ValueOf instance for it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions