summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'scala/master' into merge-2.10.xGrzegorz Kossakowski2013-07-2911-22/+27
|\
| * Merge pull request #2746 from soc/topic/paulp-typer-debug-outputAdriaan Moors2013-07-2910-20/+25
| |\ | | | | | | Improve type printing (toString/debugging)
| | * Make -Ytyper-debug output readable.Paul Phillips2013-07-178-15/+17
| | |
| | * Cleanups in type printing.Paul Phillips2013-07-173-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More consistency as to how to understand aliases, singletons, specialized symbols, subclasses. Fewer weird special casings, like normalizing tuples and functions during type printing, but nothing else. I avoid "normalize" entirely now, and do not make special cases for dealiasing, which is already well handled when printing error messages. Look at the change to test/files/neg/t2641.check to get a sense of why we should resist calling normalize during the early days of a compilation run. Anonymous and refinement classes can be printed far more usefully by revealing their parents, and that too is here. Hardened toString against undesirable side effects. Make toString final to discourage any further rogue toString overriders. Make safeToString a little safer.
* | | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-07-295-18/+38
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/transform/Mixin.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/StdAttachments.scala test/files/neg/macro-override-macro-overrides-abstract-method-b.check test/files/run/t7569.check
| * | Rename t7636-neg.check to the standard t7636.check.Adriaan Moors2013-07-291-0/+0
| | | | | | | | | | | | Not sure which partest bug allowed this, but the old name was wrong.
| * | Merge pull request #2738 from retronym/ticket/7636Grzegorz Kossakowski2013-07-272-0/+17
| |\ \ | | | | | | | | SI-7636 Fix a NPE in typing class constructors
| | * | SI-7636 Fix a NPE in typing class constructorsChristopher Vogt2013-07-162-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we encountered an erroneous super call due to a failure in parent type argument inference, we must avoid inspecting the untyped children of erroneous trees.
| * | | SI-7657 clarifies the "macro overrides method" ruleEugene Burmako2013-07-143-18/+21
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we allow macros to override non-abstract methods (in order to provide performance enhancements such as foreach for collections), and we also disallow macros to override abstract methods (otherwise downcasting might lead to AbstractMethodErrors). This patch fixes an oversight in the disallowing rule that prohibited macros from overriding a concrete method if that concrete method itself overrides an abstract method. RefCheck entertains all overriding pairs, not only the immediate ones, so the disallowing rule was triggered. Now macros can override abstract methods if and only if either the base type or the self type contain a matching non-abstract method.
* | | Merge pull request #2737 from retronym/ticket/7669Adriaan Moors2013-07-295-2/+23
|\ \ \ | | | | | | | | SI-7669 Fix exhaustivity warnings for recursive ADTs.
| * | | SI-7669 Fix exhaustivity warnings for recursive ADTs.Jason Zaugg2013-07-175-2/+23
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pattern matcher's analysis was correctly finding models under which the match in the enclosed test could fail. But, when trying to render that model as a counter example, it ran into an internal inconsistency and gave up. That inconsistency arose from VariableAssignment, which: > turn the variable assignments into a tree > the root is the scrutinee (x1), edges are labelled > by the fields that are assigned a node is a variable > example (which is later turned into a counter example) In the process, it notes the unreachable case `V2 = NotHandled`, which can only arise if `V1 = Op`, ie the scrutinee is `Op(NotHandled())`. V2 is assosicated with the path `x1.arg`. The code then looked for any variable assosicated with the prefix `x1` and registered that its field `arg` was assosicated with this variable assignment. However, the assignment for `V1 = NotHandled` (another missing case) is also associated with the path `x1`. Registering this field makes no sense here; we should only do that for `Op`. This commit conditionally registers the fields based on the class of `VariableAssignment#cls`. We no longer hit the inconsistency in `VariableAssignment#allFieldAssignmentsLegal`. This favourably changes the results of two existing tests. I had to tweak the counter example pruning to avoid relying on CounterExample.==, which is flaky in the light of Nil and List(). It is possible to have: A, B where A != B && A.coveredBy(B) && B.coveredBy(A) Luckily it is straightforward to implement pruning entirely with coveredBy.
* | | Merge pull request #2690 from soc/SI-7620Adriaan Moors2013-07-296-49/+2
|\ \ \ | | | | | | | | SI-7620 Remove floating-point-literals-without-digit-after-dot
| * | | SI-7620 Remove floating-point-literals-without-digit-after-dotSimon Ochsenreither2013-06-286-49/+2
| | | |
* | | | SI-7695 Macro debug output on -explaintypesSom Snytt2013-07-275-0/+29
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | It looks like checkConforms should wait for error before using explainTypes, rather than turning on macro debug trace if explaintypes is set. In particular, macro debug output is Console.println instead of reporter.echo or similar, so partest can't test it.
* | | Merge pull request #2714 from scalamacros/topic/quasiquotesAdriaan Moors2013-07-103-0/+27
|\ \ \ | | | | | | | | Quasiquotes
| * | | macro impls can now return subtypes of c.TreeEugene Burmako2013-07-103-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 10229316db allowed macro impls to take and return values of type c.Tree in addition to the usual c.Expr. However it didn't take into account that it is often useful to return subtypes of trees (e.g. with quasiquotes that expand into expressions typed as precisely as possible). This patch fixes that oversight.
* | | | Merge pull request #2717 from retronym/ticket/6574Adriaan Moors2013-07-102-0/+17
|\ \ \ \ | | | | | | | | | | SI-6574 Support @tailrec for extension methods.
| * | | | SI-6574 Support @tailrec for extension methods.Jason Zaugg2013-07-102-0/+17
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when the body of an extension method is transplanted to the companion object, recursive calls point back to the original instance method. That changes during erasure, but this is too late for tail call analysis/elimination. This commit eagerly updates the recursive calls to point to the extension method in the companion. It also removes the @tailrec annotation from the original method.
* | | | Merge pull request #2650 from paulp/issue/6221Adriaan Moors2013-07-083-7/+12
|\ \ \ \ | |_|/ / |/| | | SI-6221 inference with Function1 subtypes.
| * | | SI-6221 inference with Function1 subtypes.Paul Phillips2013-06-133-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There appears to be no upper bound on the number of places we have to remove calls to typeSymbol and introduce calls to baseType. This one was type inference for function parameter types: worked when expected type was A => B, but not if there was an implicit conversion from A => B to the expected type.
* | | | Merge pull request #2694 from adriaanm/masterGrzegorz Kossakowski2013-07-012-7/+5
|\ \ \ \ | | | | | | | | | | Merge 2.10.x into master
| * \ \ \ Merge 2.10.x into masterAdriaan Moors2013-06-282-7/+5
| |\ \ \ \ | | |_|/ / | |/| | / | | | |/ | | |/| | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Duplicators.scala src/library/scala/concurrent/Future.scala test/files/jvm/scala-concurrent-tck.scala
| | * | SI-7571 Allow nesting of anonymous classes in value classesJason Zaugg2013-06-192-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5d9cde105e added deep prohibition of nested classes within a value class. This has the undesirable side effect of prohibiting partial functions literals in method bodies of a value class. The intention of that prohibition was to avoid problems in code using Type Tests, such as: class C(val inner: A) extends AnyVal { class D } def foo(a: Any, other: C) = a match { case _ : other.D } Here, the pattern usually checks that `a.$outer == other`. But that is incongruent with the way that `other` is erased to `A`. However, not all nested classes could lead us into this trap. This commit slightly relaxes the restriction to allow anonymous classes, which can't appear in a type test. The test shows that the translation generates working code.
* | | | Merge pull request #2620 from magarciaEPFL/backendish33Adriaan Moors2013-07-014-1/+26
|\ \ \ \ | |/ / / |/| | | new bytecode emitter, GenBCode (11th attempt)
| * | | more informative name for backend-selection via command-lineMiguel Garcia2013-06-272-2/+2
| | | |
| * | | new bytecode emitter, GenBCode, for now under a flagMiguel Garcia2013-06-014-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenBCode is a drop-in replacement for GenASM with several advantages: - faster: ICode isn't necessary anymore. Instead, the ASTs delivered by CleanUp (an expression language) are translated directly into a stack-language (ASM Tree nodes) - future-proofing for Java 8 (MethodHandles, invokedynamic). - documentation included, shared mutable state kept to a minimum, all contributing to making GenBCode more maintainable than its counterpart (its counterpart being GenICode + GenASM). A few tests are modified in this commit, for reasons given below. (1) files/neg/case-collision Just like GenASM, GenBCode also detects output classfiles differing only in case. However the error message differs from that of GenASM (collisions may be show in different order). Thus the original test now has a flags file containing -neo:GenASM and a new test (files/neg/case-collision2) has been added for GenBCode. The .check files in each case show expected output. (2) files/pos/t5031_3 Currently the test above doesn't work with GenBCode (try with -neo:GenBCode in the flags file) The root cause lies in the fix to https://issues.scala-lang.org/browse/SI-5031 which weakened an assertion in GenASM (GenBCode keeps the original assertion). Actually that ticket mentions the fix is a "workaround" (3) files/run/t7008-scala-defined This test also passes only under GenASM and not GenBCode, thus the flags file. GenASM turns a bling eye to: An AbstractTypeSymbol (SI-7122) has reached the bytecode emitter, for which no JVM-level internal name can be found: ScalaClassWithCheckedExceptions_1.E1 The error message above (shown by GenBCode) highlights there's no ScalaClassWithCheckedExceptions_1.E1 class, thus shouldn't show up in the emitted bytecode (GenASM emits bytecode that mentions the inexistent class).
* | | | SI-7292 Fixes test failures by updating *.check filesSimon Ochsenreither2013-06-212-12/+12
| | | | | | | | | | | | | | | | | | | | Looks like partest's confusion about / vs. \ was fixed between the original Jenkins run of the fix for SI-7292 and its merge.
* | | | Merge pull request #2342 from soc/SI-7292Adriaan Moors2013-06-206-0/+34
|\ \ \ \ | | | | | | | | | | SI-7292 Deprecate octal escape literals
| * | | | SI-7292 Deprecate octal escape literalsSimon Ochsenreither2013-04-046-0/+34
| | | | |
* | | | | Merge pull request #2625 from paulp/pr/no-useless-implicitsGrzegorz Kossakowski2013-06-195-28/+29
|\ \ \ \ \ | | | | | | | | | | | | SI-6899, prohibit dangerous, useless implicit conversions.
| * | | | | SI-6899, prohibit dangerous, useless implicit conversions.Paul Phillips2013-06-045-28/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase eligibility requirements for implicit conversions, such that T => U is ineligible if T <: Null <or> AnyRef <: U This has the salutary effect of allowing us to ditch 16 ridiculous implicits from Predef, since they existed solely to work around the absence of this restriction. There was one tiny impact on actual source code (one line in one file) shown here, necessitated because the literal null is not eligible to be implicitly converted to A via <:<. def f[A](implicit ev: Null <:< A): A = null // before def f[A](implicit ev: Null <:< A): A = ev(null) // after As impositions go it's on the tame side.
* | | | | | Merge pull request #2631 from retronym/ticket/5022Grzegorz Kossakowski2013-06-191-2/+2
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-5022 Retain precise existentials through pattern matching
| * | | | | SI-5022 Retain precise existentials through pattern matchingJason Zaugg2013-06-051-2/+2
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the dawn of scalac's existentials, the typer widens existentials pt-s by substituting wildcard types in places of existential quantifiers. In this example: class ForSomeVsUnapply { def test { def makeWrap: Wrap = ??? def useRep[e](rep: (e, X[e])) = () val rep = makeWrap match { case Wrap(r) => r }; useRep(rep) // error } } the type of `r` is the result of typechecking: Apply( fun = TypeTree( tpe = (rep#12037: (e#12038, X#7041[e#12038]) forSome { type e#12038 }) args = Bind(r @ _) :: Nil } This descends to type the `Bind` with: pt = (e#12038, X#7041[e#12038]) forSome { type e#12038 } `dropExistential` clobbers that type to `Tuple2#1540[?, X#7041[?]]`, which doesn't express any relationship between the two instances of the wildcard type. `typedIdent` sort of reverses this with a call to `makeFullyDefined`, but only ends up with: pt = (Any#3330, X#7041[_1#12227]) forSome { type _1#12227; type e#12038 } I suspect that this existential dropping only makes sense outside of typechecking patterns. In pattern mode, type information flows from the expected type onwards to the body of the case; we must not lose precision in the types. For SIP-18 friendly existentials, one `dropExistential` is invertable with `makeFullyDefined`, so this hasn't been such a big problem. The error message improvement conferred by SI-4515 took a hit. That might be a good example to consider when reviewing this change: Does it tell us anything interesting about this `dropExistential` business?
* | | | | Merge pull request #2596 from retronym/ticket/7519Jason Zaugg2013-06-092-0/+25
|\ \ \ \ \ | | | | | | | | | | | | SI-7519 Less brutal attribute resetting in adapt fallback
| * | | | | SI-7519 Less brutal attribute resetting in adapt fallbackJason Zaugg2013-05-252-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses track of which enclosing class of the given name is referenced by a `This` node which prefixes the an applied implicit view. The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804
* | | | | | Merge pull request #2622 from scalamacros/pullrequest/paradisePaul Phillips2013-06-072-1/+11
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Backport from paradise/macros
| * | | | | fixes a crash on a degenerate macro definitionEugene Burmako2013-06-072-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous version of the MacroImplReference extractor didn't take into the account the fact that RefTree.qualifier.symbol can be null (and it can be null if RefTree is an Ident, because then qualifier is an EmptyTree). This led to NPEs for really weird macro defs that refer to local methods as their corresponding macro impls. Now I check for this corner case, and the stuff now longer crashes. This was wrong; this is how I fixed it; the world is now a better place.
* | | | | | Merge branch 'pr/merge-2.10.2' into masterPaul Phillips2013-06-0410-13/+53
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pr/merge-2.10.2: SI-7375 ClassTag for value class aliases SI-7507 Fix lookup of private[this] member in presence of self type. SI-7532 Fix regression in Java inner classfile reader SI-7517 Fix higher kinded type inference regression SI-7516 Revert "SI-7234 Make named args play nice w. depmet types" A test case for a recent LUB progression. SI-7421 remove unneeded extra-attachement in maven deploy SI-7486 Regressions in implicit search. SI-7509 Avoid crasher as erronous args flow through NamesDefaults SI-6138 Centralize and refine detection of `getClass` calls SI-7497 Fix scala.util.Properties.isMac SI-7473 Bad for expr crashes postfix Increase build.number to 2.10.3 SI-7391 Always use ForkJoin in Scala actors on ... ... Java 6 and above (except when the porperty actors.enableForkJoin says otherwise) Reimplementing much of the DefaultPromise methods Optimizations: 1) Avoiding to call 'synchronized' in tryComplete and in tryAwait 2) Implementing blocking by using an optimized latch so no blocking ops for non-blockers 3) Reducing method size of isCompleted to be cheaper to inline 4) 'result' to use Try.get instead of patmat c.typeCheck(silent = true) now suppresses ambiguous errors Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/macros/contexts/Typers.scala src/compiler/scala/reflect/reify/package.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/Types.scala
| * \ \ \ \ \ Merge remote-tracking branch 'origin/2.10.2' into pr/mergePaul Phillips2013-06-034-13/+16
| |\ \ \ \ \ \ | | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.2: SI-7532 Fix regression in Java inner classfile reader SI-7517 Fix higher kinded type inference regression SI-7516 Revert "SI-7234 Make named args play nice w. depmet types" SI-7486 Regressions in implicit search. SI-7509 Avoid crasher as erronous args flow through NamesDefaults
| | * | | | | Merge pull request #2590 from paulp/issue/7486Jason Zaugg2013-05-272-13/+0
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7486 Regressions in implicit search.
| | | * | | | | SI-7486 Regressions in implicit search.Paul Phillips2013-05-232-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert e86832d7e8 and dd33e280e2.
| | * | | | | | SI-7509 Avoid crasher as erronous args flow through NamesDefaultsJason Zaugg2013-05-232-0/+16
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for SI-7238 caused this regression. This commit marks taints whole Apply with an ErrorType if it has an erroneous argument, so as to stop a later crash trying to further process the tree.
| * | | | | | SI-7507 Fix lookup of private[this] member in presence of self type.Jason Zaugg2013-05-312-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the following code: trait Cake extends Slice trait Slice { self: Cake => // must have self type that extends `Slice` private[this] val bippy = () // must be private[this] locally(bippy) } `ThisType(<Slice>)`.findMember(bippy)` excluded the private local member on the grounds that the first class in the base type sequence, `Cake`, was not contained in `Slice`. scala> val thisType = typeOf[Slice].typeSymbol.thisType thisType: $r.intp.global.Type = Slice.this.type scala> thisType.baseClasses res6: List[$r.intp.global.Symbol] = List(trait Cake, trait Slice, class Object, class Any) This commit changes `findMember` to use the symbol of the `ThisType`, rather than the first base class, as the location of the selection.
| * | | | | | Merge pull request #2578 from retronym/ticket/6138Adriaan Moors2013-05-292-0/+12
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6138 Centralize and refine detection of `getClass` calls
| | * | | | | | SI-6138 Centralize and refine detection of `getClass` callsJason Zaugg2013-05-232-0/+12
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `getClass` is special cased in the compiler; this is described in in the comments on `Definitions.Any_getClass`. Part of this happens in `Typer#stabilize`. This was trying to determine if an Ident or Select node was a call to `getClass` by merits of the name of the tree's symbol and by checking that the its type (if it was a MethodType or PolyType) had no parameters in the primary parameter list. Overloaded user defined `getClass` methods confused this check. In the enclosed test case, the tree `definitions.this.getClass` had an `OverloadedType`, and such types always report an empty list of `params`. This commit: - changes `stabilize` to use `isGetClass`, rather than the homebrew check - changes `isGetClass` to consider a `Set[Symbol]` containing all `getClass` variants. This moves some similar code from `Erasure` to `Definitions` - keeps a fast negative path in `isGetClass` based on the symbol's name
| * / / / / / SI-7473 Bad for expr crashes postfixSom Snytt2013-05-232-0/+14
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes building PostfixSelect robust against a bad pos on its operand, which can happen if a bad for expression results in an EmptyTree.
* | | | | | Revert "SI-7517 type constructors too eagerly normalized."Paul Phillips2013-06-032-34/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 14534c693d2eb6acafaf8244c14b5643388fbd67. It turns out this approach was breaking the working variations in the submitted test case even as it was unbreaking the unworking one, but I never managed to uncomment them. Fortunately retronym's test case was not so lackadaisical.
* | | | | | Merge pull request #2615 from paulp/issue/7517Paul Phillips2013-06-032-0/+34
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-7517 type constructors too eagerly normalized.
| * | | | | SI-7517 type constructors too eagerly normalized.Paul Phillips2013-05-312-0/+34
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think 403eadd0f1 was largely a symptomatic remedy (not that we shouldn't harden against such outcomes) and that this commit gets closer to the root causes. The unanticipated change to test/files/run/t6113.check is like a cry of support from the jury box. -Foo[[X](Int, X)] +Foo[AnyRef{type l[X] = (Int, X)}#l] We should continue to look at calls to normalize with grave suspicion.
* | | | | refactors macro compilationEugene Burmako2013-05-287-39/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrades the way that macro defs are compiled by factoring out most of the logic in typedMacroBody and related errors in ContextErrors into an standalone cake. This leads to tighter cohesion and better code reuse as the cake is isolated from the rest of the compiler and is much easier to evolve than just a method body. Increased convenience of coding macro compilation allowed me to further clarify the implementation of the macro engine (e.g. take a look at Validators.scala) and to easily implement additional features, namely: 1) Parameters and return type of macro implementations can now be plain c.Tree's instead of previously mandatory c.Expr's. This makes macros more lightweight as there are a lot of situations when one doesn't need to splice macro params (the only motivation to use exprs over trees). Also as we're on the verge of having quasiquotes in trunk, there soon will be no reason to use exprs at all, since quasiquotes can splice everything. 2) Macro implementations can now be defined in bundles, standalone cakes built around a macro context: http://docs.scala-lang.org/overviews/macros/bundles.html. This further reduces boilerplate by simplifying implementations complex macros due to the fact that macro programmers no longer need to play path-dependent games to use helpers.