MCQs > IT & Programming > Scala > Choose the expression that allows the code to compile

Scala MCQs

For the code below abstract class A { type B <: C abstract class C { def superClassM(b: B): D } class EImpl extends C { def superClassM(b: B): D = { val e = func1(this, b) e } } def func1(b: B, b1: B): D = D(b, b1) case class D(a: B, b: B) } The code produces the following compile error found : EImpl.this.type (with underlying type A.this.EImpl) required: A.this.B val e = func1(this, b) ^

Choose the expression that allows the code to compile

Answer

Correct Answer: type B = C

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it