| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
A baby step toward its eventual elimination.
WANTED, DEAD OR ALIVE
For Heinous Crimes Against Efficiency and Scrutability
lateDEFERRED lateFINAL lateINTERFACE lateMODULE
notPROTECTED notPRIVATE notOVERRIDE lateMETHOD
ON THE RUN
lateMETHOD
|
| |
|
|\
| |
| | |
SI-7421 remove unneeded extra-attachement in maven deploy
|
| | |
|
|\ \
| | |
| | | |
SI-7403 Stream extends Serializable
|
| | |
| | |
| | |
| | |
| | | |
Additionally, add @deprecatedInheritance to warn creators of
custom subclasses that the class will be sealed in the future.
|
|\ \ \
| | | |
| | | | |
SI-4365 nondeterministic failure in asSeenFrom
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Under some order-dependent conditions (if source files arrive
in one order it happens, in the other order it does not) more
than one set of type parameters are created for a given class.
Previously this would lead to a crash in asSeenFrom when a type
parameter had to be matched up with a type application.
Now when that situation arises I compare them by name and log
a dev warning if it hits. This does not risk anything undesirable
happening because the wayward type parameter's owner is always
the right class; it's only the class type parameters which don't
include the wayward one. Since in a given type parameter list
names are unique, we have enough information to salvage the
search.
|
|\ \ \
| | | |
| | | | |
check added instruction to ASM MethodNode
|
| | | | |
|
|\ \ \ \
| |_|_|/
|/| | | |
Minor overhaul of lub-producing typer methods.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
There were a number of inefficiencies and unnecessary
indirections in these methods. I beat them into better shape.
Some highlights:
- eliminated ptOrLub and similar. We must do something to
suppress peoples' urge to tack a Boolean onto another method:
these methods returned (Type, Boolean) and in addition to
being horribly inefficient, it's vastly harder to follow the
logic. Anything which can be written with a Boolean parameter
or multi-value return can probably be written without the
Boolean parameter and/or the multi-value return.
- eliminated all the vars in the lub producing methods.
Again, it's just a lot easier to understand code when I
don't have to keep scanning up and down to see where and
how previously declared names are being changed midstream.
- added "sameWeakLubAsLub", which is the bit of information
which was being tacked onto ptOrLub. This lets them all find
out in advance whether the lub result implies further tree
adaptation is necessary.
|
| | | |
| | | |
| | | |
| | | | |
Same result, simpler expression.
|
| | | |
| | | |
| | | |
| | | | |
Obvious fusion of "isFullyDefined" and "makeFullyDefined".
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Tree and Symbol each have the analogous method, so consistency
calls along with utility for putting it on Type.
|
|\ \ \ \
| |_|/ /
|/| | | |
Quieting down a bunch of warnings.
|
| |\ \ \
| |/ / /
|/| | |
| | | |
| | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Contexts.scala
|
|\ \ \ \
| | | | |
| | | | | |
SI-7345 Refactoring Contexts
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Contexts.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
ticket/7345-2 ~/code/scala qbin/scala
Welcome to Scala version 2.11.0-20130416-231609-7829011884 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import language.experimental._import language.experimental._
scala> import reflect.macros.Contextimport reflect.macros.Context
scala> def showContextImpl(c: Context) = {println(c.asInstanceOf[reflect.macros.runtime.Context].callsiteTyper.context.enclosingContextChain.mkString("\n\n")); c.literalUnit}
showContextImpl: (c: scala.reflect.macros.Context)c.Expr[Unit]
scala> def showContext = macro showContextImpldefined term macro showContext: Unit
scala> object Foo { def foo(a: Any) { {class C { println("") }; showContext } } }Context(<console>) {
owner = method foo
tree = Block:{ class C extends scala.AnyRef { def <init>(): C = { super.<init>(); (
scope = 1 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = method foo
}
Context(<console>) {
owner = method foo
tree = DefDef:def foo(a: Any): Unit = { class C extends scala.AnyRef { def <init>():
scope = 1 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object Foo
}
Context(<console>) {
owner = object Foo
tree = Template(scala.AnyRef, _, 2 stats)
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object Foo
}
Context(<console>) {
owner = object Foo
tree = ModuleDef:object Foo extends scala.AnyRef { def <init>(): Foo.type = { super.<in
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
Context(<console>) {
owner = object $iw
tree = Template(scala.AnyRef, _, 2 stats)
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
Context(<console>) {
owner = object $iw
tree = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
ImportContext { import $line18.$read.$iw.$iw.$iw.$iw.showContext; outer.owner = object $iw }
ImportContext { import $line17.$read.$iw.$iw.$iw.$iw.showContextImpl; outer.owner = object $iw }
ImportContext { import reflect.macros.Context; outer.owner = object $iw }
Context(<console>) {
owner = object $iw
tree = Template(scala.AnyRef, _, 5 stats)
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
Context(<console>) {
owner = object $iw
tree = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
ImportContext { import language.experimental._; outer.owner = object $iw }
Context(<console>) {
owner = object $iw
tree = Template(scala.AnyRef, _, 3 stats)
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
Context(<console>) {
owner = object $iw
tree = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
Context(<console>) {
owner = object $iw
tree = Template(scala.AnyRef, _, 2 stats)
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $iw
}
Context(<console>) {
owner = object $iw
tree = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $read
}
Context(<console>) {
owner = object $read
tree = Template(scala.AnyRef, _, 2 stats)
scope = 0 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = object $read
}
Context(<console>) {
owner = object $read
tree = ModuleDef:object $read extends scala.AnyRef { def <init>(): $line19.$read.type =
scope = 1 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = package $line19
}
Context(<console>) {
owner = package $line19
tree = PackageDef:package $line19 { object $read extends scala.AnyRef { def <init>(): $l
scope = 1 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = package <root>
}
Context(<console>) {
owner = package <root>
tree = EmptyTree:<empty>
scope = 50 decls
contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
outer.owner = package <root>
}
ImportContext { import scala.this.Predef._; outer.owner = package <root> }
ImportContext { import scala._; outer.owner = package <root> }
ImportContext { import java.this.lang._; outer.owner = package <root> }
Context(NoCompilationUnit) {
owner = package <root>
tree = Template(Nil, _, 0 stats)
scope = 50 decls
contextMode = MacrosEnabled
outer.owner = <none>
}
defined object Foo
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In favour of a val calculated during construction. Internalizes
the depth calculation into the Context constructor rather than
leaving it in the hands of the factory method `make`.
Also touched a few unrelated doc comments.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Also refactored `handleOverloaded` to avoid use of a mutable Buffer
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
According to Hubert, during normal operation we can start buffering
errors in a context with existing errors. So the warning would be noisy.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Rather than keeping a List[ImportInfo] around as a field.
This sort of change reduces our bug exposure by structurally
enforcing the invariant that `Context#imports` must mirror
the `outer` chain.
This entails changing a few elements of Contexts from mutable
vars to constructor pararameters, which seems desirable anyway.
We no longer need `makeNewImport`, as `make` now inspects
the provided tree and determines does import specific things
(tracking of used imports / mixin of ImportContext) when
appropriate.
The only wrinkle in this commit is the unfortunate need to pass
`owner = null` in the extends clause of NoContext. I don't see
cleaner way around this.
Applied minor rework to `implicitss` to avoid needlessly re-evaluating
`imports` and `nextOuter`.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When we are using a throwaway silent context, we can just let it drift out of
scope and over the horizon, rather than ceremoniously flushing its buffers
on completion.
- Applied to Scaladoc.
- Applied to Infer#isApplicableSafe. Less manual error buffer management
affords greater opportunity to cleanly express the logic.
- Applied to `typerReportAnyContextErrors`.
The reasoning for the last case is as follows:
- There were only two callers to `typerReportAnyContextErrors`, and
they both passed in as `c` a child context of `context`.
- That child context must share the error reporting mode and buffer
with `context`.
- Therefore, extracting an error from `c` and issuing it into `context`
is a no-op. Because the error buffer is Set, it was harmless.
This part will probably textually conflict with the same change made in
SI-7319, but the end results are identical.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Use `firstError match {}` rather than `if (c.hasErrors) c.firstError ..`
- Convert implementation comments to doc comments
- Add new doc comments
- Refactor `Context#make` for better readability.
- Note a few TODOs.
- Roughly delineate the internal structure of Contexts with comments.
- Combine `mode` and `state` methods into `contextMode`.
- Move `isNameInScope` closer to its compadres.
- Improving alignment, tightening access.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Collapse overloads of `rootContext`
- make `atOwner` more concise
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- merge `Context#{buffer, warningBuffer}` into `Context#reportBuffer`.
- only expose immutable copies of the error and warnings buffers
- Introduce a convenience method, `firstError`.
- replace `condBufferFlush` more specific methods to retain or
clear errors by error kind.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Out with the old, in with the new. `isLocal()`, which
has been removed, was unused. `isLocal`, the new entry,
has the same semantics as `Symbol#isLocal`.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Obsolete since ee02ad59c, as best as I can judge.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Used default arguments and removed of variations only used
in one place.
I couldn't eliminate them all: one remaining overload avoids
allocating a new context when the scope/owner/tree don't change,
but moving this optimizatin to the primary overload of make breaks
things. This is noted in a TODO comment.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- This is a value class in the same spirit of Mode.
- Code that temporarily changes mode can be simplified
by saving and restoring this one field.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7402 List extends Serializable
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
While we are all aware of the issues around Serialization,
I think in this case it is perfectly sound and safe to make
List serializable:
- List is not an interface, it is the base type of an ADT.
Common behavior of its members should be reflected in the base type.
- List is sealed, there is no chance of an user providing a new
non-serializable subtype of List.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Par-Test allows redefinition of srcDir by Ant
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Since srcDir is no longer used to extract the test kind from any
given test path, it is especially benign to rely on the defness
of srcDir in order to allow redefinition during an Ant run.
The parameter is configured via the partest.srcdir property.
Maybe the keyword should be def for definite values and
red for redefinable values and ind for indefinite values.
And ded for dedefinable values optionally reset to None.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Disabled failing bitset test.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
It's a couple orders of magnitude out of whack when a test
demands a gigabyte of memory to pass. We might need to start
collecting per-test stats to avoid this kind of thing in the
future. It's a huge waste of time.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
No, this isn't busywork, how dare you suggest
such a thing. I intend my tombstone to say
HERE LIES EXTEMPORE,
WHO ELIMINATED A LOT OF SIP-18 WARNINGS
REST IN PEACE
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Some unused private code, unused imports, and points where
an extra pair of parentheses is necessary for scalac to have
confidence in our intentions.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
And also about what a compiler identifier with a $ is likely
to look like. So it can stop burying me in warnings about missing
String interpolators which aren't so missing.
|
| |_|_|/
|/| | |
| | | |
| | | | |
Sorry, my schooling in warning suppression was deficient.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6898 Document AnyVal box and unbox implemention by BoxesRunTime
|