| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The problem is that the repl underneath the script engine evaluates input to
val res0..resN, so it is a one shot operation. To allow repetition,
compile(script) now returns a CompiledScript object whose eval method can be
called any number of times.
|
|\ |
|
| |\
| | |
| | | |
Fix bug with super-accessors / dependent types
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Super-accessors are generated as `DefDef`'s with `EmptyTree` as a
placeholder for the RHS. This is filled in later in `Mixin` in
`completeSuperAccessor`.
A change in `Uncurry` (SI-6443 / 493197f), however, converted this
to a `{ EmptyTree }`, which evaded the pattern match in mixin.
This commit adds a special case to the dependent method treatment
in Uncurry to avoid generating redundant blocks.
|
| |\ \
| | | |
| | | | |
[nomaster] Backport variance validator performance fix
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
% time qbin/scalac test/files/pos/t8146-performance.scala
real 0m2.015s
user 0m2.892s
sys 0m0.215s
% time scalac-hash v2.10.3 test/files/pos/t8146-performance.scala
real 1m13.652s
user 1m14.245s
sys 0m0.508s
Cherry-picks one hunk from 882f8e64.
|
|\ \ \
| | | |
| | | | |
Merge 2.10.x
|
| |\| |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| | |\ \
| | | |/
| | |/| |
Repair symbol owners after abandoned named-/default-args
|
| | | |
| | | |
| | | |
| | | |
| | | | |
As everone knows, undo/reset/retype/rollback are bandaids; we
should try to treat the disease more directly.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Names/Defaults eagerly transforms an application with temporaries
to maintain evaluation order, and dutifully changes owners of
symbols along the way.
However, if this approach doesn't work out, we throw away this
and try a auto-tupling. However, we an still witness symbols
owned by the temporaries.
This commit records which symbols are owned by the context.owner
before `transformNamedApplication`, and rolls back the changes
before `tryTupleApply`.
Perhaps a better approach would be to separate the names/defaults
applicability checks from the evaluation-order-preserving transform,
and only call the latter after we have decided to go that way.
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We can't backport SI-7120 to 2.10.x as it changes erased signatures,
which can lead to interop problems between 2.10.3 and 2.10.4.
But, we can detect one of the nasty symptoms -- a bridge method
with the same signature as its target -- and treat that.
This commit detects duplicate bridges in the ASM (only) backend
and removes them.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Check files updated: test/files/presentation/t8085*.check
Conflicts:
build.xml
src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A source file like:
import foo.bar
package object baz
Is parsed into:
package <empty> {
import foo.bar
package baz {
object `package`
}
}
A special case in Namers compensates by adjusting the owner of
`baz` to be `<root>`, rather than `<empty>`.
This wasn't being accounted for in `BrowserTraverser`, which
underpins `-sourcepath`, and allows the presentation compiler to
load top level symbols from sources outside those passes as
the list of sources to compile.
This bug did not appear in sources like:
package p1
package object p2 { ... }
... because the parser does not wrap this in the `package <empty> {}`
This goes some way to explaining why it has gone unnoticed for
so long.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We used to silently skip class files that would exceed the JVM's size limits.
While rare, this should still be an error.
While I was at it, also included the name of the offending method.
|
| | |\
| | | |
| | | | |
Revert ", importable _."
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit d2316df920ffa4804fe51e8f8780240c46efa982.
We can't make `_` an illegal identifier -- it's legal in Java,
so we must be able to name these Java underscores.
|
| | |\ \
| | | |/
| | |/| |
Fix inliner cycle with recursion, separate compilation
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
ICodeReaders, which decompiles JVM bytecode to ICode, was not
setting the `recursive` attribute of `IMethod`. This meant that
the inliner got into a cycle, repeatedly inlining the recursive
call.
The method name `filter` was needed to trigger this as the inliner
heuristically treats that as a more attractive inlining candidate,
based on `isMonadicMethod`.
This commit:
- refactors the checking / setting of `virtual`
- adds this to ICodeReaders
- tests the case involving `invokevirtual`
I'm not sure how to setup a test that fails without the other changes
to `ICodeReader` (for invokestatic and invokespecial).
|
|\ \ \ \
| |/ / /
|/| | | |
Fix compilation under -Ydebug
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This need for this output is highly situational and since we've
starting using this resettter in case classes and names/defaults,
it is polluting our consoles.
|
|\ \ \ \
| | | | |
| | | | | |
A few minor changes to standard liftable instances and liftable support
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previous ones were inscrutable but thankfully @xeno_by
helped me out to find better alternatives.;
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previous encoding of Liftables which had universe passed in
as a parameter required a cast to solve path-dependant
madness problems:
trait OldLiftable[T] { def apply(u: Universe, v: T): u.Tree }
In this case compiler wasn't smart enough to find out that
liftFoo(universe, foo)
returns the same type of tree we were working with (universe.Tree)
and we had to cast to make it work:
liftFoo(universe, foo).asInstanceOf[universe.Tree]
Now this cast is redundant as universe is not a parameter of
Liftable's apply.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Make overloading, defaults restriction PolyType aware
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Named/Default args levies an implementation restriction that
only one overloaded alternative may declare defaults.
But, this restriction failed to consider polymorphic methods.
Rather than matching on MethodType, this commit uses `Type#paramms`,
which handles PolyTypes and curried MethodTypes in one fell swoop.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Dotless type application for infix operators.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When you have an aesthetic expresion like
def f(xs: Iterator[Int]) = (
xs takeWhile (_ < 1000)
map (_ * -1)
filter (_ % 2 == 0)
flatMap (x => List(x, x))
reduceOption (_ + _)
maxBy (_.toString)
)
And then for whatever reason you have to perform explicit
type application in the midst of that expression, it's
aggravating in the extreme that it has (had) to be rewritten
in its entirety to accommodate that change.
So now you can perform type application in the middle of it.
For reasons not entirely clear to me postfix operators are
excluded. The discussion as well as the approval for the infix
variation of it can be found at:
https://groups.google.com/forum/#!msg/scala-language/eJl1wnkEz9M/hR984-lqC5EJ
|
|\ \ \ \ \
| | | | | |
| | | | | | |
improvements to GenBCode
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
SI-5604 was fixed in commit e6f10b07d44f0ddde26246b4a41527a84eede81c
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The assert in question was aimed at ruling out
gotos (ie "jumping-applys") in actual argument position
of a jumping-apply.
But the assert in question went overboard
to also rule out a LabelDef in actual argument position.
This commit removes the assert in question altogether.
The unwanted behaviors, and only those, are rule out by
the test added in this commit and the existing tests for SI-6089.
See also https://issues.scala-lang.org/browse/SI-7749
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
aced32d05c97651534f468bc9a475ea5f6ae75b8 removed unused code,
along with code that populates a cache with entries needed
in some program runs. I'm re-adding the latter.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
f27f2d80d759130597b652d6cc9d789f8c472e5a modifies GenASM, we follow suite here,
making test/files/run/static-module-method.scala pass under GenBCode.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
7d62df035cd4393c73e7530e1cad1130e79d90c6 modifies GenASM, we follow suite here.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8126 adds a -source option to let (parts of) the compiler run on older code
|
| | | | | | | |
|
| | | | | | | |
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | | |
This is aimed at letting the 2.11+ compiler operate, at least until
phase:typer, on a 2.10 codebase.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Quasiquotes used to fail to generate proper fresh identifiers for
anonymous functions like:
q"_ + _"
Due to improper initialization of FreshNameCreator in quasiquote
parser which was erroneously not preserved throughout parsing of
the code snippet but re-created on every invocation.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Count lines by EOLs
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Source lines were counted by "line break chars", including FF.
Clients of `pos.line` seem to all expect the ordinary line num,
so that is what they get.
Unicode processing now precedes line ending processing.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Deprecate automatic () insertion in argument lists
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This promotes the () insertion warning from -Ywarn-adapted-args to a
deprecation warning. -Xfuture tunrs it into a compiler error.
Auto tupling remains unchanged for now.
The tests have been fixed the following way:
- Warnings caused by general sloppiness (Try(), Future(), ...) have been
fixed.
- Warnings which raise interesting questions (x == (), ...) received an
updated checkfile for now.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8132 Fix false "overrides nothing" for case class protected param
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Case class parameters that are less-than-public have an accessor
method created. In the enclosed test, we saw:
case class G extends AnyRef with T with Product with Serializable {
override <synthetic> <stable> <caseaccessor> def s$1: String = G.this.s;
<caseaccessor> <paramaccessor> private[this] val s: String = _;
override <stable> <accessor> <paramaccessor> protected def s: String = G.this.s;
...
}
This commit removes the OVERRIDE flag from the accessor method,
which avoids the spurious "overrides nothing" error.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
reshuffles names for blackbox/whitebox contexts, changes bundle notation
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This code is currently unused, so I’m removing it in order to avoid bitrot.
Once we’re sure that we can trust Scala reflection with our macros, the
removed file can be easily reinstated.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
As per Jason’s feedback, this commit handles overloaded constructors
in macro bundles. The backend now checks that we have a constructor of
a correct type. The frontend now prohibits multiple constructors altogether.
|