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
Types$$TypeRef Types$$SubType stack overflow #13
Comments
Imported From: https://issues.scala-lang.org/browse/SI-13?orig=1 |
@dubochet said: |
@dubochet said: bug1279a.scala:34: error: no type parameters for method all4ImplSI-4259: (MSI-3759{type TSI-4288 <: USI-4285})StreamSI-437[MSI-3759{type TSI-4291 <: USI-4285}] exist so that it can be applied to arguments (firstSI-4262.selfTypeSI-3770)
--- because ---
result type StreamSI-437[MSI-3759{type TSI-4291 <: USI-4285}] is incompatible with expected type StreamSI-437[MSI-3759{type TSI-4264 <: USI-4261}]
def all4Impl[U](first: M {type T <: U}): Stream[M {type T <: U}] = Stream.cons(first, all4Impl(first.next)) Not ideal, but workable. I lowered priority but leave it open. [martin] |
@odersky said: |
@paulp said: abstract class M {
type T
def all4Impl[U](first: M { type T <: U }): Stream[M { type T <: U }] =
Stream.cons(first, all4Impl(Stream.empty))
} |
@adriaanm said: |
@soc said (edited on May 4, 2012 1:59:57 AM UTC): // TODO!!! fix this bug for real, it compiles successfully, but weird types are inferred
def all4Impl[U](first: M {type T <: U}): Stream[M {type T <: U}] = Stream.cons(first, all4Impl(first.next)) results in <console>:34: error: type mismatch;
found : first.selfType
(which expands to) M{type T <: first.T}
required: M{type T <: Nothing}
def all4Impl[U](first: M {type T <: U}): Stream[M {type T <: U}] = Stream.cons(first, all4Impl(first.next))
^ Does this change the status of the bug? |
@paulp said: |
== Code ==
== What happened ==
== What expected ==
successful compilation
The text was updated successfully, but these errors were encountered: