| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \
| |_|/
|/| | |
Improve unchecked warnings.
|
| | |
| | |
| | |
| | |
| | | |
Spurious test was not good. Better test avoids suppressing
some legitimate warnings. Review by @moors.
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
Changed behavior so that when determining the target variance of a method parameter,
the variance in formals comes first. If variance is still undecided by that,
the variance in the result type is used as a secondary criterion.
(This is also done when determining prototype type params.)
|
|/
|
|
| |
test that matchEnd that's an argument of || that's in tail position is in tail position
|
|\
| |
| | |
SI-1832 consistent symbols in casedef's pattern&body
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
the only change to typedBind in this commit (beyond refactoring to keep my eyes from bleeding),
is explained by the added comment:
have to imperatively set the symbol for this bind to keep it in sync with the symbols used in the body of a case
when type checking a case we imperatively update the symbols in the body of the case
those symbols are bound by the symbols in the Binds in the pattern of the case,
so, if we set the symbols in the case body, but not in the patterns,
then re-type check the casedef (for a second try in typedApply for example -- SI-1832),
we are no longer in sync: the body has symbols set that do not appear in the patterns
since body1 is not necessarily equal to body, we must return a copied tree,
but we must still mutate the original bind
|
|\ \
| |/
|/| |
Deprecate all JVM 1.5 targets and make 1.6 default.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a check if deprecated target is being used. I put
that check into `checkDeprecatedSettings`. I tried to
invent some general mechanism for deprecating choices
in ChoiceSetting but I gave up eventually. It wasn't
worth it the complexity. Also, with current approach
I'm able to provide nice, customized deprecation
warning.
Make `jvm-1.6` a default backend.
Altered test for SI-5957 because it crashes the backend.
However, the problem is not with backend but with symbol
creation. We get two different symbols with the same
internal name and both are used in trees that reach
GenASM. See SI-6109 for details.
Review by @magarciaEPFL and @paulp.
|
|\ \
| |/
|/| |
test case closes SI-6047
|
| |
| |
| |
| | |
The bug is not reproducible both in M4 and in M5.
|
|\ \
| | |
| | | |
SI-5892 allow implicit views in annotation args
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
the problem was that lazy annotations got completed in phase pickler.
the `inferView` method in Typers bails out if `isPastTyper`. now the
lazy annotations completes `atPhase(typerPhase)`. test case in `pos`.
the second test case in `neg` is for another bug that is discussed in
a comment of SI-5892. when type checking arguments of type parameter
annotations, the class members should not be in scope. this was alreay
fixed in 9129cfe9.
|
|\ \ \
| |_|/
|/| | |
move test files that fail spuriously to pending
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I have this sneaky suspicion that part of these spurious failures
are caused by the recent partest optimizations.
@axel22 already checked that compiler instances are not shared between test runs.
However, except for the benchmark test, they all have a distinct
race condition in symbol loading/type checking feel to them.
Since, in the end, the tests and/or their corresponding fixes are as likely
a culprit as the test framework, moving them out of the way until their owners
can get them back in line and they stop throwing primate wenches into our build.
We should bring them back as soon as possible, though.
|
|/
|
|
|
|
|
|
|
|
| |
Preserve names of all referenced free vars. Only the proxy symbols
have the fresh names.
The resulting natural beauty is evident in the diff of t6028.check.
This subsumes the treatment in 0e170e4b that ensured named parameter
calls cannot see mangled names; pos/t6028 confirms as much.
|
|
|
|
| |
by weakening an assertion. explained in the source comment.
|
|\
| |
| | |
SI-6022 model type-test-implication better
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
we use subtyping as a model for implication between instanceof tests
i.e., when S <:< T we assume x.isInstanceOf[S] implies x.isInstanceOf[T]
unfortunately this is not true in general.
SI-6022 expects instanceOfTpImplies(ProductClass.tpe, AnyRefClass.tpe), but
ProductClass.tpe <:< AnyRefClass.tpe does not hold because Product extends Any
however, if x.isInstanceOf[Product] holds, so does x.isInstanceOf[AnyRef],
and that's all we care about when modeling type tests
|
| |
| |
| |
| |
| |
| |
| |
| | |
Cleaned up and optimized code that maps between raw and pickled flags. Avoids mystery constants. Makes a whole bunch of new flags be pickled which were not pickled before (more precisely: Everything in InitialFlags with value greater than 1 << 31 which is not in FlagsNotPickled now gets pickled whereas before it wasn't. Among these: VARARGS, IMPLCLASS, SPECIALZED, DEFAULTINIT, SYNCHRONIZED. I am curious how many tickets will get fixed by this change.
The first one I noted is t5504, which previously enforced the buggy behavior through a neg check!
There are also some build manager check file changes that have to do with the fact that flags now print in a different order for performance reasons.
|
|\ \
| |/
|/| |
Fix SI-3836 not-really-ambiguous import detection.
|
| |
| |
| |
| |
| | |
Normalize types before declaring that two imports are ambiguous,
because they might be the same thing. Review by @moors.
|
|\ \
| |/
|/| |
[SI-4691, SI-6008] improve patmat analyses: irrefutable user-defined extractors, no-op type tests
|
| |
| |
| |
| |
| |
| |
| |
| | |
augment the equality axioms to take into account that
a type test against the static type of a variable succeeds unless the variable is null
for exhaustivity we disregard null, so the type test always succeeds
during unreachability we model this knowledge as the obvious implication
|
|/ |
|
|\
| |
| | |
Fix for exponential compile time in specialization.
|
| |
| |
| |
| | |
Review by @prokopec.
|
|\ \
| | |
| | | |
SI-4176 A repeat dose of repeated parameter type sanitization.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- During eta expansion, treat parameters of type A* as Seq[A]
- Do the same for method/class parameters as referred to by an Ident.
Also fixes SI-5967, which shows up during pattern matching.
|
| |/
|/|
| |
| | |
Errs on the side of avoiding false positives.
|
|\ \
| | |
| | | |
Renaming convertTo to to on GenTraversableOnce.
|
| | | |
|
|\| |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/library/scala/collection/MapLike.scala
src/library/scala/collection/SortedMapLike.scala
|
| |\ \
| | | |
| | | | |
Fix range positions when applying anonymous classes.
|
| | | |
| | | |
| | | |
| | | | |
@odersky
|
| |/ / |
|
| |/
| |
| |
| | |
A singleton type is a type ripe for enumeration.
|
| |\
| | |
| | | |
Fix SI-5284.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The problem was the false assumption that methods specialized
on their type parameter, such as this one:
class Foo[@spec(Int) T](val x: T) {
def bar[@spec(Int) S >: T](f: S => S) = f(x)
}
have their normalized versions (`bar$mIc$sp`) never called
from the base specialization class `Foo`.
This meant that the implementation of `bar$mIc$sp` in `Foo`
simply threw an exception.
This assumption is not true, however. See this:
object Baz {
def apply[T]() = new Foo[T]
}
Calling `Baz.apply[Int]()` will create an instance of the
base specialization class `Foo` at `Int`.
Calling `bar` on this instance will be rewritten by
specialization to calling `bar$mIc$sp`, hence the error.
So, we have to emit a valid implementation for `bar`,
obviously.
Problem is, such an implementation would have conflicting
type bounds in the base specialization class `Foo`, since
we don't know if `T` is a subtype of `S = Int`.
In other words, we cannot emit:
def bar$mIc$sp(f: Int => Int) = f(x) // x: T
without typechecking errors.
However, notice that the bounds are valid if and only if
`T = Int`. In the same time, invocations of `bar$mIc$sp` will only
be emitted in callsites where the type bounds hold.
This means we can cast the expressions in method applications
to the required specialized type bound.
The following changes have been made:
1) The decision of whether or not to create a normalized
version of the specialized method is not done on the
`conflicting` relation anymore.
Instead, it's done based on the `satisfiable` relation,
which is true if there is possibly an instantiation of
the type parameters where the bounds hold.
2) The `satisfiable` method has a new variant called
`satisfiableConstraints`, which does unification to
figure out how the type parameters should be instantiated
in order to satisfy the bounds.
3) The `Duplicators` are changed to transform a tree
using the `castType` method which just returns the tree
by default.
In specialization, the `castType` in `Duplicators` is overridden,
and uses a map from type parameters to types.
This map is obtained by `satisfiableConstraints` from 2).
If the type of the expression is not equal to the expected type,
and this map contains a mapping to the expected type, then
the tree is cast, as discussed above.
Additional tests added.
Review by @dragos
Review by @VladUreche
Conflicts:
src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
|
| |\ \
| | |/
| |/| |
SI-4842 Forbid access to in-construction this in self-constructor args
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The check was already in place for direct calls to the super constructor.
Without this additional check, ExplicitOuter crashes, as it doesn't create
an $outer pointer for the constructor-arg scoped inner object, but expects
one to exist when transforming the Outer.this reference.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As usual, .tpe -> .tpeHK. As a side note following an old theme,
if symbols of type parameters knew that they were symbols of type
parameters, they could call tpeHK themselves rather than every call
site having to do it. It's the operation which injects dummies which
should require explicit programmer action, not the operation which
faithfully reproduces the unapplied type. Were it that way, errors could
be caught much more quickly via ill-kindedness.
Seems like an improvement over lurking compiler crashes at every call
to tparam.tpe.
|
| |/
| |
| |
| | |
Empty statements are A-OK. Closes SI-5910. Review by @dragos.
|
|/ |
|
|
|
|
|
| |
There doesn't seem to be any way to do that by adding
a synthetic annotation.
|
|\
| |
| | |
SI-4831 Fix ambiguous import detection for renamed imports.
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
Fix SI-5853.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This solves two issues.
First, up to now the newly generated symbols for normalized
members were not being added to the declaration list of the
owner during `specialize`. Now they are.
Second, during `extmethods`, the extension methods generated
get an additional curried parameter list for `$this`.
Trouble was, after that, during `uncurry` and before `specialize`,
these curried parameter lists were merged into one list.
Specialization afterwards treats extension methods just
like normal methods and generates new symbols without the
curried parameter list.
The `extensionMethod` now takes this into account by checking
if the first parameter of a potential extension method has
the name `$this`.
Review by @dragos.
Review by @odersky.
|