Overriding functions with path-dependent type parameters?

(FYI, I'm using 2.9.0.1) I haven't been able to find the reason for this in the spec but the error message you get, at least, makes the ultimate reason clear. This is the key part: (Note that (_5. T1, _5.

T2) forSome { val _5: Base.this. T } does not match (_16. T1, _16.

T2) forSome { val _16: Base#T } Base.this. T is not equivalent to Base#T The former is a path-dependent type based on the instance this where as the latter is a type projection that is not instance based This appears to be due to the order of type resolution TP is resolved with respect to the evaluation of Base whereas T#P is resolved with respect to the evaluation of Derived If someone can point to the location in the spec that can explain this properly, I'd love to read it.

(FYI, I'm using 2.9.0.1) I haven't been able to find the reason for this in the spec but the error message you get, at least, makes the ultimate reason clear. This is the key part: (Note that (_5. T1, _5.

T2) forSome { val _5: Base.this. T } does not match (_16. T1, _16.

T2) forSome { val _16: Base#T } Base.this. T is not equivalent to Base#T. The former is a path-dependent type based on the instance this where as the latter is a type projection that is not instance based.

This appears to be due to the order of type resolution. TP is resolved with respect to the evaluation of Base whereas T#P is resolved with respect to the evaluation of Derived. If someone can point to the location in the spec that can explain this properly, I'd love to read it.

Thanks for pointing out the key part. I was able to extract the critical part a bit more. I'll update the post above.

– Mathias Körner Aug 12 at 18:47.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions