Skip to content

Dependent function loses information about singleton type #8128

Closed
@OlivierBlanvillain

Description

@OlivierBlanvillain
object Test {
  def id: (x: 1 | 0) => x.type = x => x
  id(0): 0
}
-- [E007] Type Mismatch Error: /test.scala:3:4 
3 |  id(0): 0
  |  ^^^^^
  |  Found:    (1 : Int) | (0 : Int)
  |  Required: (0 : Int)
1 error found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions