Choose the best reason why the code fails to compile, for the type hierarchy and expressions as following?
class A { } class B extends A {} class C { } class D extends C { } case class S[T <: A ](a: T*) {} val aa: S[A ] = S[( new B(), new A() ) val cc = S( new D() )
Correct Answer: In the expression "val cc = S( new D() )" The inferred type arguments [D] do not conform to apply method's type parameter bounds
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Scala MCQ Questions