| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
We must account for cloned symbols.
|
|\
| |
| | |
refactors handling of parent types
|
| |
| |
| |
| |
| |
| | |
Even more trees (together with Apply nodes produced by templateParents
and New nodes produced by New in TreeBuilders) now distinguish nullary
argument list from empty argument list.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This looks like a much more specific name than a generic "dummy" prefix.
CannotHaveAttrs also doesn't imply that an implementing tree should
satisfy some bigger contract. EmptyTree and emptyValDef are very unlike
each other, so there's no point in trying to unify them.
Also DummyTree.isEmpty is no longer automatically true. The notion of
trees not having positions and types by design (i.e. EmptyTree + empty
TypeTrees + emptyValDef + the new pendingSuperCall) is quite different
from the notion of an empty tree in a sense of a tree being a null object
(i.e. EmptyTree + empty TypeTrees).
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Similarly to global.emptyValDef, which is a dummy that stands for an
empty self-type, this commit introduces global.pendingSuperCall, which
stands for a yet-to-be-filled-in call to a superclass constructor.
pendingSuperCall is emitted by Parsers.template, treated specially by
Typers.typedParentType and replaced with a real superclass ctor call
by Typers.typedTemplate.
To avoid copy/paste, this commit also factors out and unifies dumminess
of EmptyTree, emptyValDef and pendingSuperCall - they all don't have a
position and actively refuse to gain one, same story for tpe.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
At the moment parser does too much w.r.t handling of parent types.
It checks whether a parent can have value arguments or not and
more importantly, it synthesizes constructors and super calls.
This approach is fundamentally incompatible with upcoming type macros.
Take for example the following two snippets of code:
`class C extends A(2)`
`class D extends A(2) with B(3)`
In the first snippet, `A` might be a type macro, therefore the super call
`A.super(2)` eagerly emitted by the parser might be meaningless. In the
second snippet parser will report an error despite that `B` might be
a type macro which expands into a trait.
Unfortunately we cannot simply augment the parser with the `isTypeMacro`
check. This is because to find out whether an identifier refers to a type
macro, one needs to perform a typecheck, which the parser cannot do.
Therefore we need a deep change in how parent types and constructors
are processed by the compiler, which is implemented in this commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of a flurry of methods such as `methPart` or `typeArguments`
to analyze applications, there is a single access point to related info:
`treeInfo.dissectApplied(tree)`
Dissection returns an instance of the `Applied` class, which can
extract parts of applications and perform other application-specific
operations, e.g. `applyCount`.
For the sake of convenience, there's also an extractor named `Applied`,
which extracts `core`, `targs` and `argss`, where core is everything
except targs and argss. Extractor works for both `Tree` and `Applied`
(in the former case, it's equivalent to first dissecting and pattern
matching).
|
|\ \
| | |
| | | |
SI-6696 removes "helper" tree factory methods
|
| | |
| | |
| | |
| | |
| | | |
Documented differences between TypeApply and AppliedTypeTree and
between Select and SelectFromTypeTree.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
As experience shows, these methods can easily be a source of confusion
for the newcomers: https://issues.scala-lang.org/browse/SI-6696.
I'm only leaving the TypeTree(tp) factory, since the facility to
set underlying types for type trees is not exposed in the public API,
as it's inherently mutable.
|
|\ \
| |/
|/| |
SI-6766 Create a continuations project in eclipse
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make the continuations plugin flag specific to the continuations library.
Remove the documentation about adding the continuation plugin from
the eclipse README.md.
One consequence of this change is that if a programmer has prefs
for the continuations eclipse project then there will be a merge conflict.
That's unavoidable without having a more sophisticated way to build
the eclipse projects.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We're missing a continuations dependency when we try to build reflect
in eclipse which causes things to die horribly. This commit adds an
eclipse project for the library portion of continuations, makes
projects that depend on the scala-library also depend on
continuations-library, and adds another bullet to the eclipse readme to
turn on the continuations plugin.
|
|\ \
| | |
| | | |
SI-6631 Handle invalid escapes in string interpolators
|
| | |
| | |
| | |
| | |
| | | |
The comment about unicode escaping fell into
the very same trap that it was warning about.
|
| | |
| | |
| | |
| | | |
Patch contributed by Rex Kerr.
|
|\ \ \
| |_|/
|/| | |
Fix typo in documentation for Seq
|
| | | |
|
|\ \ \
| | | |
| | | | |
tests for idempotency issues in the typechecker
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
For more details see https://issues.scala-lang.org/browse/SI-5464.
Check files are intentionally very precise, so that we can monitor
how the situation changes over time.
|
|\ \ \
| | | |
| | | | |
Fix for SI-6731, dropped trees in selectDynamic.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
All tickets involving selectDynamic fixed by the prior commit.
It also fixes SI-6663, but that already has a test case.
|
| | | |
| | | |
| | | |
| | | | |
I rewrote mkInvoke entirely, and boosted the test coverage.
|
|\ \ \ \
| |_|_|/
|/| | | |
Asserts about Tree qualifiers.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Encoding recent revelations about certain tree invariants
in the form of asserts.
|
|\ \ \ \
| |/ / /
|/| | | |
SI-5753 macros cannot be loaded when inherited from a class or a trait
|
| | | | |
|
| | |/
| |/|
| | |
| | |
| | | |
enclClass should be taken from Tree otherwise we can jump to declaration
class/trait.
|
|\ \ \
| |_|/
|/| | |
Adds a margin stripping string interpolator.
|
| | |
| | |
| | |
| | | |
Safer and shorter.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently only for compiler internal use.
Designed to avoid surprises if the interpolated values
themselves contain the margin delimiter.
Before:
val bip = "\n |.."
s"""fooo
|bar $bip
|baz""".stripMargin
"fooo
bar
..
baz"
After:
sm"""fooo
|bar $bip
|baz"""
"fooo
bar
|..
baz"
|
|\ \ \
| |_|/
|/| | |
SI-6718 fixes a volatile test
|
| | | |
|
|\ \ \
| | | |
| | | | |
Flag pattern matcher synthetics as synthetic.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Flagging synthetics accurately is important to allow for
useful static analysis.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
All should prefer passing flags at symbol creation to mutating
the flags field after creation.
|
|\ \ \ \
| | | | |
| | | | | |
Fix for SI-6687, wrong isVar logic.
|
| |/ / /
| | | |
| | | |
| | | |
| | | | |
Fields which back lazy vals need to be excluded via !isLazy
lest isVar return true.
|
|\ \ \ \
| | | | |
| | | | | |
Merge 2.10.0-wip into 2.10.x.
|
| |\ \ \ \
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
# By Jason Zaugg (8) and others
# Via Adriaan Moors (6) and Josh Suereth (5)
* origin/2.10.0-wip:
Removing controversial `either` method from Futures API.
SI-6624 set info of case pattern binder to help find case field accessors
Fixes SI-6628, Revert "Fix for view isEmpty."
SI-6661 - Remove obsolete implicit parameter of scala.concurrent.promise method
Fixes SI-6559 - StringContext not using passed in escape function.
SI-6648 copyAttrs must preserve TypeTree#wasEmpty
Fix raw string interpolator: string parts which were after the first argument were still escaped
Update comment.
SI-6646 `ident` or Ident is always new binding.
SI-6440 Address regressions around MissingRequirementError
Refine the message and triggering of MissingRequirementError.
SI-6640 Better reporting of deficient classpaths.
SI-6644 Account for varargs in extmethod forwarder
SI-6646 Fix regression in for desugaring.
Update tools/epfl-publish
|
| | |\ \ \
| | | | | |
| | | | | | |
Removing controversial `either` method from Futures API.
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | | |
* Removes `either` from Future
* No tests need to change, since this was an untested method.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-6640 Better reporting of deficient classpaths.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Go back to using globalError to report when a stub's info is referenced,
and only throw the MissingRequirementError when compilation really
must abort due to having a StubTermSymbol in a place where a
StubClassSymbol would have been a better choice.
This situation arises when an entire package is missing from the
classpath, as was the case in the reported bug.
Adds `StoreReporterDirectTest`, which buffers messages issued
during compilation for more structured interrogation. Use this
in two test for manifests -- these tests were using a crude means
of grepping compiler console output to focus on the relevant output,
but this approach was insufficient with the new multi-line error
message emitted as part of this change.
Also used that base test class to add two new tests: one for
the reported error (package missing), and another for a simpler
error (class missing). The latter test shows how stub symbols
allow code to compile if it doesn't the subset of signatures
in some type that refer to a missing class.
Gave the INFO/WARNING/ERROR members of Reporter sensible
toString implementations; they inherit from Enumeration#Value
in an unusual manner (why?) that means the built in toString of
Enumeration printed `Severity@0`.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- To force a failure of the stub, call a new method `failIfStub`
rather than `info`.
- Offer a broader range of potential root causes in the
error message.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In a55788e, StubSymbols were introduced to fail-slow when
the classpath was deficient. This allowed compilation to
succeed in cases when one didn't actually use the part of
class A which referred to some missing class B.
But a few problems were introduced.
Firstly, when the deferred error eventually happened, it was
signalled with abort(msg), rather than through a thrown
MissingRequirementError. The latter is desirable, as it doesn't
lead to printing a stack trace.
Second, the actual error message changed, and no longer
included the name of the class file that refers to the missing
class.
Finally, it seems that we can end up with a stub term symbol
in a situation where a class symbol is desired. An assertion
in the constructor of ThisType throws trips when calling .isClass,
before the useful error message from StubSymbol can be emitted.
This commit addresses these points, and rewords the error
a little to be more accessible. The last point is the most fragile
in this arrangement, there might be some whack-a-mole
required to find other places that also need this.
I don't see a clean solution for this, but am open to suggestions.
We should really build a facility in partest to delete
specified classfiles between groups in separate compilation
tests, in order to have tests for this. I'll work on that as a followup.
For now, here's the result of my manual testing:
[info] Set current project to default-821d14 (in build file:/Users/jason/code/scratch1/)
> compile
[info] Compiling 1 Scala source to /Users/jason/code/scratch1/target/scala-2.10/classes...
[error]
[error] while compiling: /Users/jason/code/scratch1/test.scala
[error] during phase: typer
[error] library version: version 2.10.0-RC2
[error] compiler version: version 2.10.0-RC2
...
[error] last tree to typer: Ident(SwingWorker)
[error] symbol: <none> (flags: )
[error] symbol definition: <none>
[error] symbol owners:
[error] context owners: object Test -> package <empty>
...
[error] uncaught exception during compilation: java.lang.AssertionError
[trace] Stack trace suppressed: run last compile:compile for the full output.
[error] (compile:compile) java.lang.AssertionError: assertion failed: value actors
[error] Total time: 2 s, completed Nov 10, 2012 3:18:34 PM
>
> set scalaHome := Some(file("/Users/jason/code/scala/build/pack"))
[info] Defining *:scala-home
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to default-821d14 (in build file:/Users/jason/code/scratch1/)
^[compile
[info] Compiling 1 Scala source to /Users/jason/code/scratch1/target/scala-2.10/classes...
[error] /Users/jason/code/scratch1/test.scala:4: A signature in SwingWorker.class refers to term actors in package scala which is missing from the classpath.
[error] object Test extends SwingWorker
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 2 s, completed Nov 10, 2012 3:18:45 PM
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-6624 better lookup of case field accessors for case class pattern with complicated type
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
sometimes the type checker infers a weird type for a sub-pattern of a case class/extractor pattern
this confuses the pattern matcher and it can't find the case field accessors for the sub-pattern
use the expected argument type of the extractor corresponding to the case class that we're matching
as the info for the sub-pattern binder -- this type more readily admits querying its caseFieldAccessors
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fixes SI-6628, Revert "Fix for view isEmpty."
|