Skip to content

Dependent function types: self.type and this.type not the same #6745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
b-studios opened this issue Jun 25, 2019 · 2 comments
Closed

Dependent function types: self.type and this.type not the same #6745

b-studios opened this issue Jun 25, 2019 · 2 comments

Comments

@b-studios
Copy link
Contributor

minimized code

trait Foo { self =>
  type M
  def apply(prog: (h: self.type) => h.M): M = prog(this)
}

expectation

The above code example type checks. When replacing self.type with this.type I am getting the following error:

type M is not a member of <refinement>

However, I expect self.type and this.type to be the same.

@abgruszecki
Copy link
Contributor

See also the potentially-related #6635.

@b-studios
Copy link
Contributor Author

The issue still occurs with 0.18.0-bin-20190812-0ebbcff-NIGHTLY

abgruszecki added a commit that referenced this issue Mar 9, 2020
Fix #6745: Fix handling of `this` in dependent function types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants