| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Change allow ex in hk
|
| |
| |
| |
| |
| |
| |
| | |
Reason: An inner Scala2 class might be shadowed by a same-named class in a subtype.
In Dotty this is disallowed butin Scala 2 it is possible. For instance, math.Numeric
and math.Ordering both have an inner class "Ops". Normal TypeRef types could not
select the shadowed class in Ordering is the prefix is of type Numeric.
|
| | |
|
|\ \
| | |
| | | |
Fix #884 - misdiagnosed ambiguous definition.
|
| |/
| |
| |
| |
| | |
Universal equality strikes again. Caused a bug in
isDefinedInCurrentUnit.
|
|/
|
|
| |
If an error message was supressed to count it in the total.
|
|
|
|
|
|
|
|
| |
Instead of picking one at random, throw a MergeError
which might be caught later in mergeDenot. MergeDenot
has enough info to pick a simulate Scala2 linarization
if the prefix comes from Scala2, or it rethrows the
exception so that it becomes a type error.
|
|
|
|
| |
Enforces various restrictions of definitions.
|
| |
|
|\
| |
| | |
Check that some types are not higher-kinded.
|
| |
| |
| |
| | |
Invalidates #813. Review by @darkdimius.
|
|\ \
| |/
|/| |
Change inference
|
| |
| |
| |
| | |
(scalac and dotty both produce an error here)
|
| |
| |
| |
| |
| | |
A test that checked for errors on overloading
now succeeds with the new rules.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Whenchecking whether two denotations match it is not enough
to look at the signatures. The signatures might match (on the
parameters) but the actual parametre types might be different.
The change always tests infos after signatures, effectively
turning the signature test into a pre-filter.
|
|/
|
|
| |
...unless the HK type can be eta-reduced to a class type.
|
|\
| |
| | |
Fix #756 super accessors
|
| | |
|
| |
| |
| |
| |
| | |
Introduce a new non-terminal "SimpleLiteral". Only SimpleLiterals can be
types.
|
| |
| |
| |
| |
| |
| | |
Null and 'sym are not legal as singleton types because the underlying
values are not stable. They are rejected now outright instead of issuing
a cryptic "X is not stable" error message.
|
| |
| |
| |
| | |
It's decided that constant types and purity are independent.
|
|/
|
|
|
|
| |
As the comment in pos/singletons.scala says, we currently
test only constant propagation during typer. We should also have a
test that literalize produces the literals in the right places.
|
|\
| |
| | |
Avoid crashes on double definitions
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
As the spec[1] says:
"The parts of a type T are [...] if T is an abstract type, the parts of
its upper bound;"
[1]: http://www.scala-lang.org/files/archive/spec/2.11/07-implicits.html#implicit-parameters
|
| |
| |
| |
| |
| |
| |
| |
| | |
What is checked: A self type T is a subtype of all
selftypes of classes refernced by T. That is, a self type
has to subsume all self types of its required type. Ot,
otherwise said, requirements must be closed; you cannot
discover new ones in following them.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A TypeRef can have be unresolved, either because it refers to something that's missing
from the classpath or because of transitive self type references. Instead of crashing
in sigName, we now report the error.
Achieved by defining a new exception type, MissingType, which derives from TypeError.
This catches t7933.scala, now integrated in the neg/selfreq.scala. The problem there was
a reference to AbsSettings, which was not a member of StandardScalaSettings.this,
but was a member of the required type of AbsSettings, which itself appeared in the
required type of StandardScalaSettings. We will outlaw in the next commit such transitive
required references.
Also collapsed TypeError and FatalTypeError. It was a misnomer anyway. Fatal were those
type errors that were caught and reported!
Open: Where else we should check for unresolved NamedTypes.
|
|\
| |
| | |
Avoid crasher when first token of a program is in error
|
| |
| |
| |
| |
| | |
This used to give a crash in SourcePositiom, promoted by feeding
its calculations with a negative offset.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to SIP 15 a value class C must obey the following restrictions:
C may not have secondary constructors.
C may not declare fields (other than the parameter of a value class).
C may not contain object definitions.
C may not have initialization statements.
These are enforced by this commit. We are still missing restrictions on
value class paremeters. We should review what the right set of conditions
is (probably we want to admit non-vals, and maybe even multiple
parameters).
|
| | |
|
|/
|
|
|
| |
So far no error was raised for illegal inheritance
from final or sealed classes.
|
|
|
|
|
|
| |
Add necessary logic to Mixin. Also add tests
that all parameterized traits are called with
parameters set.
|
|
|
|
|
| |
A parent trait may not be parameterized (as in T()) if the calling class does not
directly implement that trait.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Skolemize unstable prefixes in asSeenFrom provided
- the prefix appears at least once in non-variant or contra-variant position
- we are in phase typer.
After typer, we have already established soundness, so there's no need to
do skolemization again. We can simply do the (otherwise unsound) substitution
from this-type to prefix.
|
|
|
|
|
| |
A term ref is stable only if its prefix is also stable. At the same time, we
drop stability requirements where they no longer make sense (e.g. in isLegalPrefix).
|
|
|
|
| |
The phase replaces SAM closures with anonymous classes when necessary.
|
| |
|
|
|
|
|
|
| |
- Abstract classes cannot be instantiated (exceptions:
parent news and Java annotations)
- Instantiateed class must conform to its self type.
|
|
|
|
| |
Check that the self type of a class conforms to the self types of its parent classes.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
We planned this for a long time but never implemented it. Instead, we sometimes
issued an erro in Splitter, namely if reflection would have been needed to access the
member. It turns out that some tests (e.g. neg/t625) fail -Ycheck (we knew that before
and disabled) but also fail Pickling because they generate orhpan PolyParams. So rather
than patching this up it seems now is a good time to enforce the restriction for real.
|
| |
|
| |
|
|
|
|
|
| |
Reformulated matchign spec and implemented accordingly. Previous
fix for #329 would have missed third new error case in over.scala.
|
|
|
|
| |
Overriding pairs needs to match ExprTypes with field types. Closes #329.
|