| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This used to crash, as both the package and the package object
had the synthetic method in `decls`, and the typer tried to add
the tree to both places.
Now, synthetics in the package object are excluded from the pacakge
itself.
|
|
|
|
| |
Investigatory tools for SI-5877
|
|\
| |
| | |
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"
|
|\ \
| | |
| | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | | |
* 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."
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This reverts commit caf7eb6b56817fd1e1fbc1cf017f30e6f94c6bea.
I don't have a better idea right now than wholesale reversion.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6559 Fix raw string interpolator: string parts which were after the first argument were still escaped
|
| | | | |_|/ /
| | | |/| | |
| | | | | | |
| | | | | | | |
argument were still escaped
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6648 copyAttrs must preserve TypeTree#wasEmpty
|
| | | |/ / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This field tracks whether the type is an inferred
on, subject to removal in `resetAttrs`, or an explicit
type, which must remain.
In ae5ff662, `ResetAttrs` was modified to duplicate
trees, rather than mutate trees in place. But the
tree copier didn't pass `wasEmpty` on to the new tree,
which in turn meant that the subsequent typing run
on the tree would not re-infer the types. If the
type refers to a local class, e.g. the anonymous
function in the enclosed test case, the reference
to the old symbol would persist.
This commit overrides `copyAttrs` in TypeTree to
copy `wasEmpty`.
We might consider representing this as a tree
attachment, but this would need to be validated
for the performance impact.
|
| | |\ \ \ \ \
| | | |_|/ / /
| | |/| | | | |
SI-6661 - Remove obsolete implicit parameter of scala.concurrent.promise method
|
| | | |/ / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Clarification of @heathermiller:
This is an inconsistency introduced after refactoring implicit ExecutionContexts.
In commit 1dfce90246f7d334 the implicit ExecutionContexts were removed from everything else in Promise.scala,
but it appears that method promise was missed in the scala.concurrent package object, which would've made
sense to remove back then.
|
| | |\ \ \ \
| | | |_|/ /
| | |/| | | |
SI-6644 Account for varargs in extmethod forwarder
|
| | | |/ /
| | | | |
| | | | |
| | | | |
| | | | | |
Which sounded difficult, so instead I offshored the work
to the friendly republic of TreeGen.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The previous commit regressed in these cases:
// no withFilter
for (X <- List("A single ident is always a pattern")) println(X)
for (`x` <- List("A single ident is always a pattern")) println(`x`)
At the top level of the LHS of a <-, such identifiers represent
new bindings, not stable identifier patterns.
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | | |
The early check in the parser of pattern irrefutability,
added in c82ecab, failed to consider InitCaps and
`backquoted` identifiers.
|
|\ \ \ \
| | | | |
| | | | | |
findEntry implementation code more concise and DRYer.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix for SI-6357, cycle with value classes.
|
| | |_|_|/
| |/| | |
| | | | |
| | | | | |
Don't force the owner info.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6677 Insert required cast in `new qual.foo.T`
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Avoid the early return, and address micro-duplication
between adaptType and adaptMember.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Short version: we sometimes need to rewrite this as
new T(qual.asInstanceOf[OwnerOfFoo].foo)
Long version:
`adaptMember` in Erasure performs a few tasks, among them:
1. adding an empty argument list to qualifiers in `new qual.T`
for which `qual` is a val template member that has
(post uncurry) a MethodType with an empty parameter list.
The same rewriting was already applied in uncurry for such
qualifiers appearing in other contexts, e.g. `qual.foo` was
already rewritten to `qual().foo`.
2. casting, if necessary, the qualifier in `Select(qual, name)`
to the type of owner of the symbol that this selection
references.
This can be neccesary with compound types:
- some val class member has type `A with B`;
- we instantiate `new ab.valMemberOfB.T`
- we must pass `ab.valMemberOfB` to the constructor of `T`
as the `$outer` pointer
- we must cast `ab` to `B` before calling `valMemberOfB`.
Failure to insert this cast can lead to a LinkageError or
a VerifyError.
However, if 1) was performed, 2) was not.
The error is pretty easy to trigger with the new reflection
API:
class Test {
val cm: reflect.runtime.universe.Mirror
= reflect.runtime.currentMirror
def error {
new cm.universe.Traverser // java.lang.VerifyError
}
def okay1 {
val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror
new cm.universe.Traverser
}
}
The fix applied here to `adaptMember` mirrors the existing
implementation of `adaptType`.
|
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Ensure the map key and the String in the Symbol are the
same reference by removing the old key before updating the
map with the new key -> symbol relation.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Type trees created by MethodSynthesis for abstract val getters carry symless originals,
which are unusable for reification purposes
(or the result of reification will be unhygienic).
To combat this, type trees for such getters are now created empty,
i.e. without any `tpe` set, just having an original assigned.
Subsequent `typedTypeTree` invocations fill in the `tpe` and
update the original to be symful.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
SI-6673 fixes macro problems with eta expansions
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Eta expansions previously caused the typer to disable macros. That was
done in order to detect eta expansion of macro defs and show the user
an appropriate error message.
Macros were disabled because to find out whether we're expanding
a macro def, we need to get its symbol, and to get a symbol of something
we need to typecheck that something. However typechecking automatically
expands macros, so, unless we disable macros, after a typecheck we won't
be able to analyze macro occurrences anymore.
Unfortunately this solution has a fatal flaw. By disabling macros we
not only prevent the eta-expandee from macro expanding, but also all
the subtrees of that eta-expandee (see SI-6673).
This commit adds a mechanism for fine-grained control over macro
expansion. Now it's possible to prohibit only the node, but not its
children from macro expanding.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6632 SI-6633 Fixes issues and data corruption in ListBuffer
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Disallow negative positions for ListBuffer#insert/insertAll/update
- Fix data corruption issue in ListBuffer#insert
|