You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classColl[+T] {
defcontains=new { defapply[T1<:T](value: T1) =??? }
}
objectTest {
defmain(args: Array[String]):Unit= {
valxs=newColl[List[String]]
valys:Coll[Traversable[String]] = xs
println(ys contains Nil)
// java.lang.NoSuchMethodException: Coll$$anon$1.apply(scala.collection.Traversable)// at java.lang.Class.getMethod(Class.java:1605)// at Test$.reflMethod$Method1(a.scala:14)// at Test$.main(a.scala:14)// at Test.main(a.scala)
}
}
It should fail the way this does:
defcontains=new { defapply(value: T) =??? }
./a.scala:2:error: Parametertypein structural refinement may not refer to an abstracttypedefined outside that refinement
defcontains=new { defapply(value: T) =??? }
^
one error found
The text was updated successfully, but these errors were encountered:
Ring the big bell.
It should fail the way this does:
The text was updated successfully, but these errors were encountered: