Skip to content

Special handling in the typer of scala.Singleton is missing #2997

Closed
@soronpo

Description

@soronpo
  case class Foo[T <: Int with Singleton](t : T)
  val one = 1
  final val final_one = 1
  val a : 1 = Foo(1).t //Type Mismatch Error
  val b : Int = Foo(one).t //OK, but unexpected
  val c : 1 = Foo(final_one).t //Type Mismatch Error

Scastie link: https://scastie.scala-lang.org/DcDeG4eYQTG17exjb2FigQ

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions