Skip to content

Match typing with trait types doesn't work #8493

Closed
@travisbrown

Description

@travisbrown

minimized code

trait Foo; trait Bar

type Res[X] = X match {
  case Foo => String
  case Bar => Int
}

0: Res[Bar]

Compilation output

1 |0: Res[Bar]
  |^
  |Found:    (0 : Int)
  |Required: Res[Bar]

expectation

It works as expected if you change the traits to classes, or if you reverse the order of the cases.

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