Skip to content

Alt/instantiation checks #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 13, 2015

Alternative to #471. Add a separate phase that checks that abstract classes are not instantiated and that self types conform.

This is probably easier to understand than #471 because the flow is concentrated in one tree traversal instead of being indirectly established by dropping attachments and looking at them.

Review by @DarkDimius

odersky added 7 commits April 13, 2015 16:04
Now prints `C{...}` instead of `$anon`.
The self type as given (or implied for module classes) in the source.
Also defined and updated for normal types, not just ClassInfo types.
Common functionality between this and baseTypeWithArgs has been pulled
into RefinedType#wrapIfMember.
Check that the self type of a class conforms to the self types of its parent classes.
- Abstract classes cannot be instantiated (exceptions:
  parent news and Java annotations)
- Instantiateed class must conform to its self type.
Java compilation units should not be retained after typer,
as no code will be generated for them. All we need from
them are their symbols.
An error message might be suppressed because it contains internal code. But
if it is the first one, we should still print it. Otherwise, we risk a scenario where
we see "2 errors" but none is printed.
@odersky odersky force-pushed the alt/instantiation-checks branch from acfb2ac to 6571efa Compare April 13, 2015 14:07
@odersky odersky closed this Apr 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants