Skip to content
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

Method type parameter not substituted into structural refinement #9222

Open
scabug opened this issue Mar 14, 2015 · 2 comments · Fixed by scala/scala#9172
Open

Method type parameter not substituted into structural refinement #9222

scabug opened this issue Mar 14, 2015 · 2 comments · Fixed by scala/scala#9172
Milestone

Comments

@scabug
Copy link

scabug commented Mar 14, 2015

I expect the following code to compile without errors:

trait Elem {
    type Peer
}

trait Impl[E[~] <: Elem {type Peer = ~}] {
    def foo[R](peer: E[R]#Peer)

    foo[Int](??? : E[Int]#Peer)
}

Instead, an error is given that:

Error:(12, 18) type mismatch;
 found   : this.scala.Peer
    (which expands to)  Int
 required: this.Peer(in method foo)
    (which expands to)  R
    foo[Int](??? : E[Int]#Peer)
             ^^

It looks as if the variable R is not getting substituted in the structural refinement part of the type.

This comes from http://stackoverflow.com/questions/28945416/type-mismatch-with-type-projection

@scabug
Copy link
Author

scabug commented Mar 14, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9222?orig=1
Reporter: Owen Healy (ellbur)
Affected Versions: 2.11.6

@dwijnand
Copy link
Member

Reverted

@dwijnand dwijnand reopened this Oct 14, 2020
@SethTisue SethTisue modified the milestones: 2.13.4, Backlog Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants