| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
scala> class A { class C extends { val x: A = this } with AnyRef }
<console>:7: error: type mismatch;
found : A.this.C
required: A
class A { class C extends { val x: A = this } with AnyRef }
^
Note that the same thing is necessary and already done in Namers (see
def createNamer). The whole logic of when and how to create contexts
should be factored out and reused in Namer and Typer.
(
My Hobby [1]: detecting compiler by just looking at its soruce
[1] http://www.explainxkcd.com/wiki/index.php?title=Category:My_Hobby
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AnnotationCheckers are insufficient because they live outside the
compiler cake and it's not possible to pass a Typer into an annotation
checker.
Analyzer plugins hook into important places of the compiler:
- when the namer assigns a type to a symbol (plus a special hook for
accessors)
- before typing a tree, to modify the expected type
- after typing a tree, to modify the type assigned to the tree
Analyzer plugins and annotation checker can be activated only during
selected phases of the compiler.
Refactored the CPS plugin to use an analyzer plugin (since
adaptToAnnotations is now part of analyzer plugins, no longer
annotation checkers).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- when typing (and naming) a ValDef, tpt and rhs are now type checked
in the same context (the inner / ValDef context). this does not change
any behavior, but is more uniform (same as for DefDef). martin told me
(offline) that this change is desirable if it doesn't break anything.
(it doesn't).
- typeSig is now more uniform with a separate method for each case
(methodSig, valDefSig, etc). methodSig was cleaned up (no more variables)
and documented. the type returned by methodSig no longer contains /
refers to type skolems, but to the actual type parameters (so we don't
need to replace the skolems lateron).
- documentation on constructor contexts, type skolems
- more tests for SI-5543
|
|
|
|
|
|
|
|
| |
Integrates annotationsLub into lub.
Also fixes SubstSymMap when mapping over annotaion trees. I don't
understand what the previous code was supposed to achieve, but it
crashed in some of my examples.
|
|
|
|
|
| |
Also removes an unnecessary condition in UnCurry, isFunctionType(fun.tpe)
is always true.
|
| |
|
|
|
|
|
|
|
|
|
| |
as discussed in [1], this change has no impact on the scala type
system, but it can fix subtyping for annotation checkers if the
pluggable type system supports annotations that can refer to method
parameters.
[1] https://groups.google.com/forum/#!topic/scala-internals/kSJLzYkmif0/discussion
|
|\
| |
| | |
SI-6812 scaladoc can opt out of expanding macros
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a temporary change, possible only because macros currently can't
affect the global symbol table (except for the case when they will steer
inference of a method's return type).
Later on, e.g. with the addition of c.introduceTopLevel in master,
we will have to upgrade Scaladoc to allow for separate generation of
documentation, because then we'll be forced to expand macros in order to
get the whole picture of the code.
|
|\ \
| | |
| | | |
[backport] Fix for SI-6206, inconsistency with apply.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Squashed commit of the following:
commit f6bbf85150cfd7e461989ec1d6765ff4b4aeba51
Author: Paul Phillips <paulp@improving.org>
Date: Mon Oct 1 09:10:45 2012 -0700
Fix for SI-6206, inconsistency with apply.
The code part of this patch is 100% written by retronym, who
apparently has higher standards than I do because I found it just
lying around in his repository. I think I'll go pick through his
trash and see if he's throwing away any perfectly good muffins.
I made the test case more exciting so as to feel useful.
(cherry picked from commit 267650cf9c3b07e360a59f3c5b70b37fea9de453)
|
|\ \
| | |
| | | |
Revert "SI-6601 Publicise derived value contstructor after pickler"
|
| | |
| | |
| | |
| | |
| | | |
This demonstrates the need for the reversion in the
previous commit.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit b07228aebe7aa620af45a681ef60d945ffc65665.
The remedy was far worse than the disease:
% cat sandbox/test.scala
class V private (val a: Any) extends AnyVal
% RUNNER=scalac scala-hash b07228aebe sandbox/test.scala
[info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a
% scala-hash b07228aebe
[info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a
Welcome to Scala version 2.10.1-20130116-230935-b07228aebe (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def foo(v: V) = v.a == v.a
exception when typing v.a().==(v.a())/class scala.reflect.internal.Trees$Apply
constructor V in class V cannot be accessed in object $iw in file <console>
scala.reflect.internal.Types$TypeError: constructor V in class V cannot be accessed in object $iw
|
|\ \
| | |
| | | |
SI-2818 Makes List#foldRight work for large lists
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Benchmarks show that lists smaller than 110 elements or so doing
reverse/foldLeft is faster than recursively walking to the end of
the list and then folding as the stack unwinds.
Above that 110 element threshold the recursive procedure is faster.
Unfortunately, at some magic unknown large size the recursive procedure
blows the stack.
This commit changes List#foldRight to always do reverse/foldLeft.
|
|\ \ \
| | | |
| | | | |
[backport] SI-2968 Fix brace healing for `^case (class|object) {`
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Squashed commit of the following:
commit 24828531f62ce05402c96c04d7096e82d5f4e3bf
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Sun Oct 21 23:34:35 2012 +0200
SI-2968 Fix brace healing for `^case (class|object) {`
The scanner coalesces the pair of tokens into CASEOBJECT or
CASECLASS, but fails to set `offset` back to the start of `case`.
Brace healing is then unable to correctly guess the location of
the missing brace.
This commit resets `offset` and `lastOffset`, as though
caseobject were a single keyword. Only the former was neccessary
to fix this bug; I haven't found a test that shows the need for
the latter.
(cherry picked from commit cbad218dba47d49a39897b86d467c384538fdd53)
|
|\ \ \
| | | |
| | | | |
SI-6963 Add version to -Xmigration
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Adds an optional version parameter to the -Xmigration compiler setting.
Doing -Xmigration without version number behaves as it used to by
dumping every possible migration warning.
This commit adds a ScalaVersion class (plus ancillary stuff), and a
ScalaVersionSetting.
|
|\ \ \ \
| | | | |
| | | | | |
SI-3353 don't extract <unapply-selector> into named-arg local val
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This already fixes all of SI-3353 because no named-args-block is
generated anymore (they are avoided if they have a single expr).
So the same NPE in extractorFormalTypes as described in the ticket
is no longer triggered.
I think that's all there is to fix, since extractor patterns are
translated to unapply calls with one argument, i think it's not
possible to write a pattern that would result in a named-apply block.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6017 Scaladoc's Index should be case-sensitive
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6853 changed private method remove to be tail recursive.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Operations += and -= on mutable.ListMap rely on the private method remove to perform. This methods was implemented using recursion, but it was not tail recursive. When the ListMap got too big the += caused a StackOverflowError.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
10 backports
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
Saw this by accident; the trees created for early defs would
wholesale replace the modifiers with PRESUPER rather than
combining them. FINAL was lost that way, as would be any other
modifiers which might be valid there.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
Nesting recursive calls in Stream is always a dicey business.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
Prohibit `_` as an identifier, it can only bring badness.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
You don't want to do name-based selections in later phases
if you can help it, because there is nobody left to resolve
your overloads. If as in this example you're calling a
known method, use the symbol. Review by @hubertp.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
mkAttributedSelect, which creates a Select tree based on
a symbol, has been a major source of package object bugs,
because it has not been accurately identifying selections
on package objects. When selecting foo.bar, if foo turns
out to be a package object, the created Select tree must be
foo.`package`.bar
However mkAttributedSelect was only examining the owner of
the symbol, which means it would work if the package object
defined bar directly, but not if it inherited it.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
And other polishing related to varargs handling.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
The fix of course is a perfect error message.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
Remove some code, win a prize.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[backport]
This was a bad interaction between anonymous subclasses
and bridge methods.
new Foo { override def bar = 5 }
Scala figures it can mark "bar" private since hey, what's
the difference. The problem is that if it was overriding a
java-defined varargs method in scala, the bridge method
logic says "Oh, it's private? Then you don't need a varargs
bridge." Hey scalac, you're the one that made me private!
You made me like this! You!
Conflicts:
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
[backport]
The original fix for SI-2418 excluded final vars entirely, but
the problem was not final vars per se, but the emission of ACC_FINAL
in combination with ACC_VOLATILE. Since vars never get ACC_FINAL
now, this is no longer an issue.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
[backport] SI-6301 / SI-6572 specialization regressions
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
That fix has now been backported to 2.10.x in the
previous commit. This commit should be be merged
to master.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Squashed commit of the following:
commit a3680be29ccd5314c5d027d473b37940eaecd530
Author: Paul Phillips <paulp@improving.org>
Date: Fri Aug 31 10:20:16 2012 -0700
Actual fix for SI-6301, specialized crasher.
This means the workaround in the previous commit is no
longer reached, but it should remain where it is as a much
needed layer of robustness/useful error reporting.
Conflicts:
src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
commit f4c45ae204ce3ff3c16b19cab266d0b6515b6e0f
Author: Paul Phillips <paulp@improving.org>
Date: Fri Aug 31 10:49:24 2012 -0700
Rewrite of GenICode adapt.
Started for debuggability, stayed for clarify/performance.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
commit 74842f72a0af485e5def796f777f7003f969d75b
Author: Paul Phillips <paulp@improving.org>
Date: Fri Aug 31 08:45:34 2012 -0700
Workaround for SI-6301, @specialize crasher.
SpecializeTypes is generating symbols with overloaded types
which then proceed to crash in CleanUp or GenICode. Until I
or someone works out why that is, take a look in case the
overload is easily disambiguated by the argument list arity,
in which case warn and proceed.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
[backport] SI-5378, unsoundness with type bounds in refinements.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
As the comment says:
Not enough to look for abstract types; have to recursively check
the bounds of each abstract type for more abstract types. Almost
certainly there are other exploitable type soundness bugs which
can be seen by bounding a type parameter by an abstract type which
itself is bounded by an abstract type.
SPECIAL: BUY ONE UNSOUNDNESS, GET ONE FREE
In refinement types, only the first parameter list of methods
was being analyzed for unsound uses of abstract types. Second
parameter list and beyond had free unsoundness reign. That bug
as well is fixed here.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-4714 Initialize history while initializing the REPL's reader
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
It was possible to get a command into the REPL before the history
recording object was set and so the command would be lost in the sands
of time. This fix just moves the initialization of the history object
into the JLineReader constructor, out of the post-init hook.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
[backport] Removed restriction on final vars, SI-2418.
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Backport of b79c7600544db9964c228b94a2f70f3ed854f89b
The original fix for SI-2418 excluded final vars entirely, but
the problem was not final vars per se, but the emission of ACC_FINAL
in combination with ACC_VOLATILE. Since vars never get ACC_FINAL
now, this is no longer an issue.
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
[backport] the scanner is now less eager about deprecations
|
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
Due to some reason, partest always enables -deprecation. Since Paul has
just submitted a pull request, which removes this behavior, I'm updating
the flags to make sure this test works even after Paul's change.
Backport from https://github.com/scala/scala/pull/1807
Original commit is https://github.com/scala/scala/commit/2015ad3ebd833225e93ed19604760a6da2522bb1
|