summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Documented lateMETHOD flag.Paul Phillips2013-04-267-14/+50
| | | | | | | | | | | | 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
* Call method rather than duplicating method.Paul Phillips2013-04-261-1/+1
|
* Merge pull request #2450 from huitseeker/issue/SI-7421Paul Phillips2013-04-261-5/+1
|\ | | | | SI-7421 remove unneeded extra-attachement in maven deploy
| * SI-7421 remove unneeded extra-attachement in maven deployFrançois Garillot2013-04-251-5/+1
| |
* | Merge pull request #2442 from soc/SI-7403Paul Phillips2013-04-262-5/+7
|\ \ | | | | | | SI-7403 Stream extends Serializable
| * | SI-7403 Stream extends SerializableSimon Ochsenreither2013-04-252-5/+7
| | | | | | | | | | | | | | | Additionally, add @deprecatedInheritance to warn creators of custom subclasses that the class will be sealed in the future.
* | | Merge pull request #2430 from paulp/issue/4365Adriaan Moors2013-04-263-8/+72
|\ \ \ | | | | | | | | SI-4365 nondeterministic failure in asSeenFrom
| * | | SI-4365 nondeterministic failure in asSeenFromPaul Phillips2013-04-223-8/+72
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #2451 from magarciaEPFL/backendish4Grzegorz Kossakowski2013-04-251-0/+8
|\ \ \ | | | | | | | | check added instruction to ASM MethodNode
| * | | check added instruction to ASM MethodNodeMiguel Garcia2013-04-251-0/+8
| | | |
* | | | Merge pull request #2436 from paulp/pr/lub-productionPaul Phillips2013-04-257-76/+126
|\ \ \ \ | |_|_|/ |/| | | Minor overhaul of lub-producing typer methods.
| * | | Minor overhaul of lub-producing typer methods.Paul Phillips2013-04-233-70/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Simplify some checks in Refchecks.Paul Phillips2013-04-231-2/+2
| | | | | | | | | | | | | | | | Same result, simpler expression.
| * | | Added ensureFullyDefined.Paul Phillips2013-04-232-4/+3
| | | | | | | | | | | | | | | | Obvious fusion of "isFullyDefined" and "makeFullyDefined".
| * | | Added orElse to Type.Paul Phillips2013-04-232-0/+8
| | | | | | | | | | | | | | | | | | | | Tree and Symbol each have the analogous method, so consistency calls along with utility for putting it on Type.
* | | | Merge pull request #2437 from paulp/pr/warning-cleanupPaul Phillips2013-04-2439-139/+140
|\ \ \ \ | |_|/ / |/| | | Quieting down a bunch of warnings.
| * | | Merge branch 'master' into pr/warning-cleanupPaul Phillips2013-04-2421-374/+637
| |\ \ \ | |/ / / |/| | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Contexts.scala
* | | | Merge pull request #2393 from retronym/ticket/7345-2Paul Phillips2013-04-2414-358/+616
|\ \ \ \ | | | | | | | | | | SI-7345 Refactoring Contexts
| * \ \ \ Merge remote-tracking branch 'origin/master' into ticket/7345-2Jason Zaugg2013-04-2169-439/+813
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * | | | | SI-7345 Address review comments.Jason Zaugg2013-04-211-9/+8
| | | | | |
| * | | | | SI-7345 Improved Context.toStringJason Zaugg2013-04-211-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | SI-7345 Eliminate the `depth` var.Jason Zaugg2013-04-211-20/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | SI-7345 Drive by refactoring of pattern matching for `arg: _*`.Jason Zaugg2013-04-215-12/+22
| | | | | |
| * | | | | SI-7345 Factor out method to clear and restore undetparams.Jason Zaugg2013-04-213-36/+35
| | | | | | | | | | | | | | | | | | | | | | | | Also refactored `handleOverloaded` to avoid use of a mutable Buffer
| * | | | | SI-7345 Remove unneeded warning.Jason Zaugg2013-04-211-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Hubert, during normal operation we can start buffering errors in a context with existing errors. So the warning would be noisy.
| * | | | | SI-7345 Doc and TODO comments around Context.Jason Zaugg2013-04-212-1/+45
| | | | | |
| * | | | | SI-7345 Produce Context#imports from the context chainJason Zaugg2013-04-213-37/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * | | | | SI-7345 Refactor manual iteration to use foreach.Jason Zaugg2013-04-211-4/+2
| | | | | |
| * | | | | SI-7345 Move `inSilentMode` from Infer to Context.Jason Zaugg2013-04-212-16/+14
| | | | | |
| * | | | | SI-7345 remove unused methods.Jason Zaugg2013-04-211-10/+3
| | | | | |
| * | | | | SI-7345 Prefer using a throwaway silent context over buffer flushing.Jason Zaugg2013-04-214-56/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | SI-7345 More refactoring and documentation in ContextsJason Zaugg2013-04-216-130/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
| * | | | | SI-7345 Exploit named/default argsJason Zaugg2013-04-212-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Collapse overloads of `rootContext` - make `atOwner` more concise
| * | | | | SI-7345 Encapsulate warning and error buffers in ReportBuffer.Jason Zaugg2013-04-216-42/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
| * | | | | SI-7345 Add Context#isLocal, akin to Symbol#isLocalJason Zaugg2013-04-211-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * | | | | SI-7345 Use combinator to find next enclosing non-template.Jason Zaugg2013-04-211-3/+1
| | | | | |
| * | | | | SI-7345 Remove comment that appears obsolete.Jason Zaugg2013-04-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Obsolete since ee02ad59c, as best as I can judge.
| * | | | | SI-7345 Rationalize overloads of Context#makeJason Zaugg2013-04-213-37/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | SI-7345 Represent the boolean modes in Context in ContextMode.Jason Zaugg2013-04-212-91/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* | | | | | Merge pull request #2441 from soc/SI-7402Paul Phillips2013-04-244-7/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7402 List extends Serializable
| * | | | | | SI-7402 List extends SerializableSimon Ochsenreither2013-04-244-7/+9
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #2431 from som-snytt/issue/partest-srcdirPaul Phillips2013-04-241-3/+3
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Par-Test allows redefinition of srcDir by Ant
| * | | | | Par-Test allows redefinition of srcDir by AntSom Snytt2013-04-221-3/+3
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #2438 from paulp/pr/bitset-testPaul Phillips2013-04-232-5/+6
|\ \ \ \ \ | | | | | | | | | | | | Disabled failing bitset test.
| * | | | | Disabled failing bitset test.Paul Phillips2013-04-232-5/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | | * Eliminated the accumulated feature warnings.Paul Phillips2013-04-2321-38/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | | * Eliminate a pile of -Xlint warnings.Paul Phillips2013-04-2319-90/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
| | | | * Taught -Xlint about @implicitNotFound.Paul Phillips2013-04-232-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | | * Fix unchecked warning.Paul Phillips2013-04-231-3/+3
| |_|_|/ |/| | | | | | | | | | | Sorry, my schooling in warning suppression was deficient.
* | | | Merge pull request #2284 from demobox/add-box-unbox-doc-commentJason Zaugg2013-04-2310-9/+59
|\ \ \ \ | | | | | | | | | | SI-6898 Document AnyVal box and unbox implemention by BoxesRunTime