We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I am following this tutorial. Awesome work. However, I couldn't get this example working with the code provided.
trait Stream[+T] { def prepend[U >: T](elem: U) : Stream[U] = Stream.cons(elem, this) }
Compiling the code above gives me error as following.
polymorphism.scala:15: error: type mismatch; found : Stream[T] required: scala.collection.immutable.Stream[?] def prepend[U >: T](elem: U) : Stream[U] = Stream.cons(elem, this)
Did I miss something?
exercises-scalatutorial/src/main/scala/scalatutorial/sections/PolymorphicTypes.scala
Line 433 in 38531b1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I am following this tutorial. Awesome work. However, I couldn't get this example working with the code provided.
Compiling the code above gives me error as following.
Did I miss something?
exercises-scalatutorial/src/main/scala/scalatutorial/sections/PolymorphicTypes.scala
Line 433 in 38531b1
The text was updated successfully, but these errors were encountered: