Skip to content

SI-4134: abstract override crasher if lacking super impl #359

Closed
wants to merge 1 commit into from

2 participants

@som-snytt

This commit just changes the assert on a bad abstract super.m
to a compiler error. Probably it's the not that simple, right?
In this case, review is easy; but if it weren't, should I ask
on scala-internals or on the jira ticket? By way of not
wasting people's time? I was just looking for small bugs as
an excuse to look at code.

The example from the ticket is committed as a neg test.
The problem is that a super.m on an abstract override
member m has no concrete implementation, that is, the
trait T is not mixed in after a class C with a concrete m.

The error is noticed at phase mixin when the super accessor
is added to the concrete mixer. (Pun alert?) When super.m
is rebound, no concrete matching symbol is found up the
linearization.

Previously, it was asserted that such a symbol should
be found, but since this is our first opportunity to
detect that there is none, an error should be emitted
instead. The new message is of the form:

Member method f of mixin trait T2 is missing a concrete super implementation.

Additionally, a couple of flag tests were changed to use isAbstractOverride.

@som-snytt som-snytt SI-4134: abstract override crasher if lacking super impl
The example from the ticket is committed as a neg test.
The problem is that a super.m on an abstract override
member m has no concrete implementation, that is, the
trait T is not mixed in after a class C with a concrete m.

The error is noticed at phase mixin when the super accessor
is added to the concrete mixer. (Pun alert?) When super.m
is rebound, no concrete matching symbol is found up the
linearization.

Previously, it was asserted that such a symbol should
be found, but since this is our first opportunity to
detect that there is none, an error should be emitted
instead. The new message is of the form:

Member method f of mixin trait T2 is missing a concrete super implementation.

Additionally, a couple of flag tests were changed to use isAbstractOverride.
b28ece2
@paulp
paulp commented Apr 6, 2012

I had to rebase unfortunately, but this is committed.

@paulp paulp closed this Apr 6, 2012
@som-snytt som-snytt deleted the som-snytt:rebindsuper branch May 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.