Skip to content

Unable to return terms with path dependent types #9464

Closed
@nicolasstucki

Description

@nicolasstucki

Minimized code

trait T:
  type X
  def x: X

def test1(t: T): t.X = t.x
def test2(t: T): t.X = return t.x

Output

-- [E007] Type Mismatch Error: tests/pos-macros/return-quoted.scala:6:32 -------
6 |def test2(t: T): t.X = return t.x
  |                              ^^^
  |                              Found:    t.X
  |                              Required: t.X
1 error found

Expectation

Should compile

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions