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
This test currently fails:
abstractclassA[X]:deffoo(x: X):XclassIOclassCdeftest(io: {*} IO) =classBextendsA[{io} C]:// error, but should workoverridedeffoo(x: {io} C): {io} C=???
Output
7 | class B extends A[{io} C]:
| ^
|class B needs to be abstract, since def foo(x: X): X in class A is not defined
|(Note that
| parameter X in def foo(x: X): X in class A does not match
| parameter {io} C in override def foo(x: {io} C): {io} C in class B
| )
*/
Expectation
Arguably there should be a way to achieve such overridings. You can think of it as inserting a bridge method in B that implements the method in A by forwarding to the method in B and box-adapting argument and result. However, it seems that such a box adaptation could in general require some capability in B that was not required before. So this would need to be worked into the general capability propagation framework.
The test is in #16415 (as a neg-test, to be re-classified once this works).
The text was updated successfully, but these errors were encountered:
Compiler version
3.3.0
Minimized example
Output
Expectation
Arguably there should be a way to achieve such overridings. You can think of it as inserting a bridge method in B that implements the method in A by forwarding to the method in B and box-adapting argument and result. However, it seems that such a box adaptation could in general require some capability in B that was not required before. So this would need to be worked into the general capability propagation framework.
The test is in #16415 (as a neg-test, to be re-classified once this works).
The text was updated successfully, but these errors were encountered: