| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-5189 detect unsoundness when inferring type of match
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
GADT skolems encode type slack that results from pattern matching on variant type constructors
I thought they would not longer be relevant after cases have been typed,
and since they caused weird issues with the old pattern matcher, I deskolemized in typedCase
however, when we don't have an expected type for the match, we need to keep the skolems around
until the skolemized type makes it out of the match and it becomes the result of type inference for that match
when you do have an expected type, it will propagate to the case-level and the confrontation will thus
already take place when typing individual cases
|
|\ \
| | |
| | | |
SI-6126 Test case for varargs of tagged primitives.
|
| | |
| | |
| | |
| | |
| | | |
This started working after the merge fe1110f. I didn't track
down precisely which commit was responsible beyond that.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Companion objects (and thus also case classes) in package objects caused
an assert about an overloaded symbol when everything was compiled twice.
It's a hairy problem that doesn't fit in 2.10.1. So this fix adds an
implementation restriction. It also has a test to make sure the error
messages are clean and reasonably friendly, and does not catch other
things defined in package objects. The test includes a
commented out test in case somebody thinks they've solved the underlying
problem.
A handful of tests were falling afoul of the new implementation
restriction. I verified that they do in fact fail on second compile so
they aren't false casualties. But they do test real things we'd like
to work once the re-compile issue is fixed. So I added a -X flag to
disable the implementation restriction and made all the tests
accidentally clobbered by the restriction use that flag.
|
|\ \
| | |
| | | |
SI-6912 Avoid a typer cycle in overload resolution.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
c800d1fe, and followup commits 1ddc9358 and b10b5821
modified error handling in `Infer#inferExprAlternative`.
After these changes, this method could fail to resolve
the overloaded alternative if:
best != NoSymbol
&& !competing.isEmpty
&& !noAlternatives
&& pt.isErroneous
This commit calls `setError` in that case, which
prevents the cycle in `adapt`.
While I didn't extract a reproduction from the
original code base, I've included a test case that
exhibits the same symptom.
It was actually pretty tough to find an program that
got close to this code path, but luckilly we've been
pretty close to this bug in SI-5553 / 4f99c2e5, and those
test cases formed the basis for this one.
|
|\ \
| | |
| | | |
Backport of SI-6846.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Squashed commit of the following:
commit 55806cc0e6177820c12a35a18b4f2a12dc07bb39
Author: Paul Phillips <paulp@improving.org>
Date: Wed Dec 19 07:32:19 2012 -0800
SI-6846, regression in type constructor inference.
In 658ba1b4e6 some inference was gained and some was lost.
In this commit we regain what was lost and gain even more.
Dealiasing and widening should be fully handled now, as
illustrated by the test case.
(cherry picked from commit dbebcd509e4013ce02655a2687b27d0967b3650e)
commit e6ef58447d0f4ef6de956fcc03ee283bb9028c02
Author: Paul Phillips <paulp@improving.org>
Date: Fri Dec 21 15:11:29 2012 -0800
Cleaning up type alias usage.
I determined that many if not most of the calls to .normalize
have no intent beyond dealiasing the type. In light of this I
went call site to call site knocking on doors and asking why
exactly they were calling any of
.normalize
.widen.normalize
.normalize.widen
and if I didn't like their answers they found themselves
introduced to 'dropAliasesAndSingleTypes', the recursive widener
and dealiaser which I concluded is necessary after all.
Discovered that the object called 'deAlias' actually depends
upon calling 'normalize', not 'dealias'. Decided this was
sufficient cause to rename it to 'normalizeAliases'.
Created dealiasWiden and dealiasWidenChain.
Dropped dropAliasesAndSingleTypes in favor of methods
on Type alongside dealias and widen (Type#dealiasWiden).
These should reduce the number of "hey, the type alias doesn't work" bugs.
(cherry picked from commit 3bf51189f979eb0dd41744ca844fd12dfdaa0dee)
Conflicts:
src/compiler/scala/tools/nsc/interpreter/CompletionOutput.scala
commit c1d8803cea1523f458730103386d8e14324a9446
Author: Paul Phillips <paulp@improving.org>
Date: Sat Dec 22 08:13:48 2012 -0800
Shored up a hidden dealiasing dependency.
Like the comment says:
// This way typedNew always returns a dealiased type. This
// used to happen by accident for instantiations without type
// arguments due to ad hoc code in typedTypeConstructor, and
// annotations depended on it (to the extent that they worked,
// which they did not when given a parameterized type alias
// which dealiased to an annotation.) typedTypeConstructor
// dealiases nothing now, but it makes sense for a "new" to
// always be given a dealiased type.
PS:
Simply running the test suite is becoming more difficult all
the time. Running "ant test" includes time consuming activities
of niche interest such as all the osgi tests, but test.suite
manages to miss the continuations tests.
(cherry picked from commit 422f461578ae0547181afe6d2c0c52ea1071d37b)
commit da4748502792b260161baa10939554564c488051
Author: Paul Phillips <paulp@improving.org>
Date: Fri Dec 21 12:39:02 2012 -0800
Fix and simplify typedTypeConstructor.
Investigating the useful output of devWarning (-Xdev people,
it's good for you) led back to this comment:
"normalize to get rid of type aliases"
You may know that this is not all the normalizing does.
Normalizing also turns TypeRefs with unapplied arguments
(type constructors) into PolyTypes. That means that when
typedParentType would call typedTypeConstructor it would
find its parent had morphed into a PolyType. Not that it
noticed; it would blithely continue and unwittingly discard
the type arguments by way of appliedType (which smoothly
logged the incident, thank you appliedType.)
The simplification of typedTypeConstructor:
There was a whole complicated special treatment of AnyRef
here which appears to have become unnecessary. Removed special
treatment and lit a candle for regularity.
Updated lots of tests regarding newly not-so-special AnyRef.
(cherry picked from commit 394cc426c1ff1da53146679b4e2995ece52a133e)
commit 1f3c77bacb2fbb3ba9e4ad0a8a733e0f9263b234
Author: Paul Phillips <paulp@improving.org>
Date: Fri Dec 21 15:06:10 2012 -0800
Removed dead implementation.
Another "attractive nuisance" burning off time until I
realized it was commented out.
(cherry picked from commit ed40f5cbdf35d09b02898e9c0950b9bd34c1f858)
|
|/
|
|
|
|
|
|
|
| |
A bug in typers mishandled varargs. We should get more
aggressive about eliminating all the ad hoc parameter/argument
handling code spread everywhere. For varargs especially:
any code which tries to make an adjustment based on a
repeated parameter is more likely to be wrong than right.
In aggregate these reinventions are a huge source of bugs.
|
|\
| |
| | |
SI-6897, lubs and varargs star.
|
| |
| |
| |
| |
| | |
Don't allow lubs to calculate refinement types which contain
a varargs star outside of legal varargs star position.
|
|\ \
| | |
| | | |
SI-6896, spurious warning with overloaded main.
|
| |/
| |
| |
| |
| | |
Make sure there's no legit main signature before issuing
any warnings about missing main methods.
|
|\ \
| | |
| | | |
SI-6911, regression in generated case class equality.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Caught out by the different semantics of isInstanceOf and
pattern matching.
trait K { case class CC(name: String) }
object Foo extends K
object Bar extends K
Foo.CC("a") == Bar.CC("a")
That expression is supposed to be false, and with this
commit it is once again.
|
|\ \ \
| | | |
| | | | |
Fix Iterator#copyToArray (fixes SI-6827).
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As pointed out in #scala, when using a non-zero start it's possible
to get an ArrayIndexOutOfBoundsException due to an incorrect bounds
check. This patch fixes this, as well as another potential bounds
error, and adds test cases.
Incorporates some other suggestions by Som-Snytt to ensure that
callers will get useful error messages in cases where the start
parameter is wrong (negative or out-of-array-bounds).
Review by @som-snytt.
|
|\ \ \
| |/ /
|/| | |
SI-5017 Poor performance of :+ operator on Arrays
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Control performance of :+ and +: operator on my machine were 700-800 ms
After adding size hint on the implementation in SeqLike, it went down to 500-600 ms
But with specialixed implementation in ArrayOps, brings it down to 300-400 ms
Unfortunatly, this method will only be called when the Array object is being referenced directly as it's type, but that should be the case enough times to justify the extra method.
I ended up removing the sizeHint in SeqLike because it made the execution of the "benchmark" slower when the Array was being manipulated as a Seq.
Side note: Interestingly enough, the benchmark performed better on my virtualized Fedora 17 with JDK 7 than natively on Mac OS X with JDK 6
|
|\ \ \
| |_|/
|/| | |
SI-6194, repl crash.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Always a bad idea to use replaceAll on unknown strings,
as we saw here when windows classpaths arrived containing
escape-requiring backslashes.
|
|\ \ \
| | | |
| | | | |
Remove -deprecation from partest default options.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
Who knows why it was ever like this; it's not like anyone
sees the deprecation warnings. In PR #1807 there is now a
test which depends on partest not making this move, so it's
a good time to finally expunge it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Had to fix up an iffy test: not only was it testing undefined
behavior, it demanded just the right numbers be printed in a
context where all negative or positive numbers are equivalent.
It's the ol' "get them coming and going" trick.
|
|/ /
| |
| |
| |
| |
| |
| | |
The lengthCompare method in LinearSeqOptimized was looking one
step further than it needed to in order to give the correct
result, which was creating some unwanted side effects related to
Streams.
|
| |
| |
| |
| |
| |
| | |
Have to intercept trees which have a null type due to errors
before they leave the warm confines of 'def typed' because from
that point everything assumes tree.tpe != null.
|
|\ \
| | |
| | | |
Merge 2.10.0-wip into 2.10.x
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
# By Eugene Burmako (1) and others
# Via Adriaan Moors (2) and others
* origin/2.10.0-wip:
Fixing OSGi distribution.
Fix for rangepos crasher.
SI-6685 fixes error handling in typedApply
|
| | | |
| | | |
| | | |
| | | |
| | | | |
wrapClassTagUnapply was generating an unpositioned tree
which would crash under -Yrangepos. See SI-6338.
|
|\ \ \ \
| |/ / /
|/| | | |
Implicit vars should have non-implicit setters.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Otherwise they trigger spurious feature warnings.
scala> trait T { implicit var a: Any }
<console>:7: warning: implicit conversion method a_= should
be enabled by making the implicit value
language.implicitConversions visible.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6795 simplify "abstract override" errors on type members
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Instead of saying "only allowed on non-type members of traits" use
separate errors for "not allowed on types" and "only allowed on members
of traits"
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
"abstract override" shouldn't was being allowed on types in traits but the result
made no sense and the spec says that shouldn't be allowed.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-3995 Exclude companions with an existential prefix.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In the example below, we need a view from
`String => l.F0`, and the companion object `FO` is
reachable by a stable, non existentially-bound path.
class Lift {
def apply(f: F0) {}
class F0
object F0 {
implicit def f2f0(fn: String): F0 = ???
}
}
object Test {
val l = new Lift
l.apply("") // okay
}
Followup for SI-3995
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In `(qual: Q).apply(expr)` where `expr` must be implictily
converted to a path dependent type `T` defined in `qual`,
we were looking for companion implicits via a path prefixed
by an existential skolem `_1`. These aren't much good to us,
as when we try to feed them into `mkAttributedQualifer`, a
crash rightly ensues.
This commit excludes companions prefixed by an existentially
bound path.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6548 reflection now correctly enters jinners
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
When completing Java classes, runtime reflection enumerates their
fields, methods, constructors and inner classes, loads them and
enters them into either the instance part (ClassSymbol) or the
static part (ModuleSymbol).
However unlike fields, methods and constructors, inner classes don't
need to be entered explicitly - they are entered implicitly when
being loaded.
This patch fixes the double-enter problem, make sure that enter-on-load
uses the correct owner, and also hardens jclassAsScala against double
enters that can occur in a different scenario.
Since the fix is about Java-compiled classes, the test needs *.class
artifacts produced by javac. Therefore I updated javac-artifacts.jar to
include the new artifacts along with their source code.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
fixes incorrect handling of Annotated in lazy copier
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|/ / /
|/| | | | | | | |
SI-5390 Detect forward reference of case class apply
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
These are only forbidden in terms, they are permitted in
types.
|
| | |_|/ / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Refchecks performs (among others) two tasks at once:
- detecting forward references
- translating `qual.Case(...)` to `new qual.Case(...)`
As is often the case with such multi-tasking tree traversals,
completion of one task precluded the other.
|
|\ \ \ \ \ \ \
| |_|_|_|_|_|/
|/| | | | | | |
SI-5361 Avoid cyclic type with malformed refinement
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The statement `val x = this` in the refinment type:
(new {}): {val x = this}
is lazily typechecked, in order to, according to the comment
in `typedRefinment, "avoid cyclic reference errors".
But the approximate type used ends up with:
Refinment@1(
parents = [...]
decls = { val x: Refinement@1 })
This commit eagerly checks that there is no term definitions
in type refinments, rather than delaying this.
This changes the error message for SI-3614.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
typedIdent no longer destroys attachments
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
When transforming Idents to qualified Selects, typedIdent used to forget
about carrying original attachments to the resulting tree. Not anymore.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6288 Perfecting positions
|