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
annotation in inferred type, spurious type error #8071
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8071?orig=1 |
@retronym said: class ann extends annotation.StaticAnnotation
object Use {
val dataSetup = new AnyRef { // <---- error reported here
class Mem { def x: (Int @ann) = 0 }
type Memory = Mem
}
}
/**
error: type mismatch;
found : AnyRef{type Mem(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>) <: AnyRef{def x: Int}; type Memory = this.Mem(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>)}
required: AnyRef{type Mem(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>) <: AnyRef{def x: Int @ann}; type Memory = this.Mem(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>)(in <refinement of AnyRef>)}
*/ |
@retronym said: |
@paulp said: I lost count at some point but I didn't notice that many refinements of AnyRef. Might be time to do something about this type printing pathology. |
@paulp said: |
As reported: http://stackoverflow.com/questions/20460274/confusing-scala-type-mismatch-error-with-uncheckedvariance-in-signature/20460991
The text was updated successfully, but these errors were encountered: