summaryrefslogtreecommitdiff
path: root/src/reflect
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3817 from phaller/topic/typetagsLukas Rytz2014-07-154-28/+42
|\ | | | | SI-5919 TypeTags and Exprs should be serializable
| * Add SerialVersionUID to SerializedTypeTag and SerializedExprPhilipp Haller2014-07-152-2/+2
| | | | | | | | | | | | | | The reason for adding the SerialVersionUID annotations is to be able to provide serialization stability throughout the 2.11.x series. And since type tags (and exprs) have not been serializable before, this does not break serialization for existing code.
| * SI-5919 TypeTags and Exprs should be serializablePhilipp Haller2014-07-154-28/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make TypeCreator and TreeCreator extend Serializable. - When replacing a SerializedTypeTag with a TypeTag or WeakTypeTag, do not use scala.reflect.runtime.universe.rootMirror, since it is unlikely to find user classes; instead, create a runtime mirror using the context ClassLoader of the current thread. Use the same logic for SerializedExpr. - Remove writeObject/readObject methods from SerializedTypeTag and SerializedExpr since they are unused. - Add @throws annotation on writeReplace and readResolve methods. - Handle SecurityException if the current thread cannot access the context ClassLoader. - To make type tags of primitive value classes serializable, make PredefTypeCreator a top-level class. Otherwise, it would retain a reference to the enclosing Universe, rendering the TypeCreator non-serializable. Binary compatibility: - Keep nested PredefTypeCreator class to avoid backward binary incompatible change. - Keep `var` modifiers on the class parameters of SerializedTypeTag for backward binary compatibility. - Adds filter rules to forward binary compatibility whitelist: - `TypeCreator`, `PredefTypeCreator`, and `TreeCreator` must now extend from `Serializable`. - Must have new class `scala.reflect.api.PredefTypeCreator` to avoid problematic outer reference.
* | Merge pull request #3858 from densh/si/8703Jason Zaugg2014-07-151-2/+2
|\ \ | | | | | | SI-8703 add support for blocks with just a single expression to quasiquotes
| * | SI-8703 add support for blocks with just a single expression to quasiquotesDenys Shabalin2014-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was impossible to match a block that was constructed as Block(Nil, term) Due to the fact that quasiquotes always flatten those into just term. This is a correct behaviour for construction (for sake of consistency with parser) but doing it in deconstruction mode make it impossible to match such blocks which could have been constructed manually somewhere. To fix this we just disable block flattening in deconstruction mode. Interestingly enough this doesn't break existing code due to the fact that quasiquote's block matcher also matches expressions as single-element blocks. This allows to match single-element blocks with patterns like q"{ $foo }".
* | | Merge pull request #3845 from xeno-by/topic/attachment-subclassingJason Zaugg2014-07-151-1/+1
|\ \ \ | | | | | | | | relaxes attachment-matching rules
| * | | relaxes attachment-matching rulesEugene Burmako2014-07-101-1/+1
| |/ / | | | | | | | | | | | | | | | It came as a surprise recently, but attachments.contains/get/update/remove require the class of the payload to match the provided tag exactly, not taking subclassing into account. This commit fixes the oversight.
* | | Merge pull request #3844 from xeno-by/topic/rangepos-subpatternsJason Zaugg2014-07-151-1/+1
|\ \ \ | |_|/ |/| | prevents c.internal.subpatterns from destroying rangeposes
| * | prevents some reflection APIs from destroying rangeposesEugene Burmako2014-07-101-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit continues the work started in fcb3932b32. As we've figured out the hard way, exposing internally maintained trees (e.g. macro application) to the user is dangerous, because they can mutate the trees in place using one of the public APIs, potentially corrupting our internal state. Therefore, at some point we started duplicating everything that comes from the user and goes back to the user. This was generally a good idea due to the reason described above, but there was a problem that we didn't foresee - the problem of corrupted positions. It turns out that Tree.duplicate focuses positions in the tree being processed, turning range positions into offset ones, and that makes it impossible for macro users to make use of precise position information. I also went through the calls to Tree.duplicate to see what can be done to them. In cases when corruptions could happen, I tried to replace duplicate with duplicateAndKeepPositions. Some notes: 1) Tree rehashing performed in TreeGen uses duplicates here and there (e.g. in mkTemplate or in mkFor), which means that if one deconstructs a macro argument and then constructs it back, some of the positions in synthetic trees might become inaccurate. That's a general problem with synthetic trees though, so I don't think it should be addressed here. 2) TypeTree.copyAttrs does duplication of originals, which means that even duplicateAndKeepPositions will adversely affect positions of certain publicly accessible parts of type trees. I'm really scared to change this though, because who knows who can use this invariant. 3) Some methods that can be reached from the public API (Tree.substituteXXX, c.reifyXXX, c.untypecheck, ...) do duplicate internally, but that shouldn't be a big problem for us, because nothing is irreversibly corrupted here. It's the user's choice to call those methods (unlike with TypeTree.copyAttrs) and, if necessary, they can fixup the positions themselves afterwards. 4) Macro engine internals (macro impl binding creation, exploratory typechecking in typedMacroBody) use duplicate, but these aren't supposed to be seen by the user, so this shouldn't be a problem. 5) Certain parser functions, member syntheses and typer desugarings also duplicate, but in those cases we aren't talking about taking user trees and screwing them up, but rather about emitting potentially imprecise positions in the first place. Hence this commit isn't the right place to address these potential issues.
* | Merge pull request #3867 from lrytz/t8708Lukas Rytz2014-07-091-5/+37
|\ \ | | | | | | SI-8708 Fix pickling of LOCAL_CHILD child of sealed classes
| * | SI-8708 Fix pickling of LOCAL_CHILD child of sealed classesLukas Rytz2014-07-071-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a sealed class or trait has local children, they are not pickled in as part of the children of the symbol (introduced in 12a2b3b to fix Aladdin bug 1055). Instead the compiler adds a single child class named LOCAL_CHILD. The parents of its ClassInfoType were wrong: the first parent should be a class. For sealed traits, we were using the trait itself. Also, the LOCAL_CHILD dummy class was entered as a member of its enclosing class, which is wrong: it represents a local (non-member) class, and it's a synthetic dummy anyway.
* | | Remove deprecationWarning, currentReporting from ReportingAdriaan Moors2014-07-043-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | This moves us a bit closer to the goal of having a single entry point to reporting. Must modularize Reporting a bit so it can be used in Variances (need a reference to `currentRun` in `reflect.internal.Reporting`).
* | | Track symbol that caused a deprecation warning.Adriaan Moors2014-07-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that we can filter deprecations based on defining package. Configurable error reporting will support a rule like: "In compilation unit X, escalate deprecation warnings that result from accessing members in package P that have been deprecated since version V. Report an error instead of a warning for those." TODO: remove deprecationWarning overload that doesn't take a `Symbol`? (Replace by a default value of `NoSymbol` for the deprecated symbol arg?)
* | | Uniformly route reporting through reporter.Adriaan Moors2014-07-042-7/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sharpen interfaces, reduce footprint of Reporting trait. Ideally, all reporting should indirect through reporter, and the `Reporting` trait itself should be restricted to a single method that retrieves the current `reporter`. Pull up some more reporting to reflect.internal. Would like to do more, but need to move partest to the reflect.internal interface first. (Its `errorCount` relies on `ERROR.count` in `tools.nsc.Reporter`.)
* | | Move reporting logic into Reporting traitAdriaan Moors2014-07-043-15/+37
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move code from Global/SymbolTable to separate Reporting traits to start carving out an interface in scala.reflect.internal.Reporting, with internals in scala.tools.nsc. Reporting is mixed into the cake. It contains a nested class PerRunReporting. Should do the same for debugging/logging. The idea is that CompilationUnit and Global forward all reporting to Reporter. The Reporting trait contains these forwarders, and PerRunReporting, which accumulates warning state during a run. In the process, I slightly changed the behavior of `globalError` in reflect.internal.SymbolTable: it used to abort, weirdly. I assume that was dummy behavior to avoid introducing an abstract method. It's immediately overridden in Global, and I couldn't find any other subclasses, so I don't think the behavior in SymbolTable was ever observed. Provide necessary hooks for scala.reflect.macros.Parsers#parse. See scala/reflect/macros/contexts/Parsers.scala's parse method, which overrides the reporter to detect when parsing goes wrong. This should be refactored, but that goes beyond the scope of this PR. Don't pop empty macro context stack. (Ran into this while reworking -Xfatal-warnings logic.) Fix -Xfatal-warnings behavior (and check files): it wasn't meant to influence warning reporting, except for emitting one final error; if necessary to fail the compile (when warnings but no errors were reported). Warnings should stay warnings. This was refactored in fbbbb22946, but we soon seem to have relapsed. An hour of gitfu did not lead to where it went wrong. Must've been a merge.
* | Merge pull request #3736 from VladimirNik/print-types-issue-2.11.xAdriaan Moors2014-07-031-14/+27
|\ \ | | | | | | SI-8447 fix TypeTree printing (2.11.x)
| * | TypeTree printing modified (SI-8447)VladimirNik2014-05-091-14/+27
| | |
* | | Merge pull request #3772 from densh/si/8609Adriaan Moors2014-07-031-0/+2
|\ \ \ | |_|/ |/| | SI-8609 Fix flattening of definitions and imports in quasiquotes
| * | SI-8609 Fix flattening of definitions and imports in quasiquotesDenys Shabalin2014-05-211-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quasiquotes allow to unquote trees with ..$ with block flattening semantics to simplify composition: val onetwo = q"1; 2" val onetwothree = q"..$onetwo; 3" // same as q"1; 2; 3" If there is no block it will be equivalent to $ unquoting: val one = q"1" val onetwo = q"..$one; 2" // same as q"1; 2" But the inconsistency here is that currently only terms support this single-element semantics. This commit extends this functionality to also support definitions and imports. So that following code works: val q1 = q"val x = 1" val q2 = q"..$q1; val y = 2" // same as q"val x = 1; val y = 2"
* | Merge pull request #3796 from som-snytt/issue/8630Adriaan Moors2014-06-031-1/+1
|\ \ | | | | | | SI-8630 lineToString no longer long by one at eof
| * | SI-8630 lineToString no longer long by one at eofSom Snytt2014-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One more EOL crasher, or lack-of-EOL crasher, when the text is at EOF. It was not caught by the last round of excellent and thorough tests because ``` // If non-whitespace tokens run all the way up to EOF, // positions go wrong because the correct end of the last // token cannot be used as an index into the char array. // The least painful way to address this was to add a // newline to the array. ```
* | | Merge pull request #3789 from clhodapp/fix/SI-6678Adriaan Moors2014-06-031-1/+2
|\ \ \ | | | | | | | | SI-6678 Make currentMirror macro hygenic
| * | | SI-6678 Make currentMirror macro hygenicclhodapp2014-05-231-1/+2
| | |/ | |/|
* | | Merge pull request #3774 from lrytz/opt/backendWipLukas Rytz2014-06-011-56/+50
|\ \ \ | |_|/ |/| | More type safe implementation of BType, cleanups in GenBCode
| * | Re-use the exsiting range of the name table when using subName.Lukas Rytz2014-05-211-4/+10
| | | | | | | | | | | | The sub-name can just point to a smaller range of the array.
| * | Cleanups in Names.scalaLukas Rytz2014-05-211-53/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enter only fully constructed Name objects into the hash table, this should make lookupTypeName thread-safe. Clean up lookupTypeName - the hash code for a type name is the same as for its correspondent term name. Going from a type name toTermName should never create a new TermName instance. Assert that.
| * | Minor cleanups and commenting around BType.Lukas Rytz2014-05-211-3/+6
| |/ | | | | | | Use `length` instead of `size` on arrays in `reflect/internal/Names`.
* / Optimize nested scope creationJason Zaugg2014-05-263-15/+14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can copy the hash table from the parent scope, rather than constructing it from scratch. This takes us to: % rm -rf /tmp/pkg; (for i in {1..50}; do for j in {1..100}; do echo "package pkg { class A_${i}_${j}___(val a: Int, val b: Int) }"; done; done) > sandbox/A1.scala && time qbin/scalac -Ybackend:GenASM -J-Xmx1G -J-XX:MaxPermSize=400M -d /tmp sandbox/A1.scala; real 0m19.639s // head~1 was 0m35.662s user 0m41.683s // head~1 was 0m58.275s sys 0m1.886s In more detail, this commit: - Removes the unused `fingerprint` constructor parameter from scopes. This is a remnant from a previous optimization attempt - Leave only one constructor on Scope which creates an empty scope - Update the factory method, `newNestedScope`, to copy the hash table from the parent if it exists. We can rely on the invariant that `outer.hashTable != null || outer.size < MIN_HASH)`, so we don't need `if (size >= MIN_HASH) createHash()` anymore. This used to be needed in `Scope#<init>`, which accepted an aribitrary `initElems: ScopeEntry`. - Update subclasses and factories of `Scope` in runtime reflection to accomodate the change. Pleasingly, we could actually remove the override for `newNestedScope`. - Unit tests the functionality I'm touching
* Merge commit 'ec05aeb' into topic/merge-2.10.xJason Zaugg2014-05-082-1/+6
|\
| * Merge pull request #3678 from retronym/ticket/8479Jason Zaugg2014-04-071-0/+5
| |\ | | | | | | SI-8479 Fix constructor default args under scaladoc
| | * SI-8479 Fix constructor default args under scaladocJason Zaugg2014-04-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `DocDef` node hid the `DefDef` constructor from the scrutinee of the namer when determining if the class had constructor defaults or not. The current pattern for fixing these bugs is to delegate the check to `TreeInfo`, and account for the wrapper `DocDef` node. I've followed that pattern, but expressed my feelings about this approach in a TODO comment. Before this patch, the enclosed test failed with: error: not enough arguments for constructor SparkContext: (master: String, appName: String)SparkContext
| * | Merge pull request #3655 from retronym/ticket/8442Grzegorz Kossakowski2014-03-261-1/+1
| |\ \ | | | | | | | | SI-8442 Ignore stub annotation symbols in `AnnotationInfo#matches`
| | * | SI-8442 Ignore stub annotation symbols in `AnnotationInfo#matches`Jason Zaugg2014-03-251-1/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And update the java `ClassFileParser` to create distinguished `StubClassSymbol`s, rather that a regular `ClassSymbol`s, when encountering a deficient classpath. This brings it into line with `Unpickler`, which has done as much since a55788e275f. This stops the enclosed test case from crashing when determining if the absent symbol, `A_1`, is a subclass of `@deprecated`. This is ostensibly fixes a regression, although it only worked in `2.10.[0-3]` by a fluke: the class file parser's promiscious exception handling caught and recovered from the NPE introduced in SI-7439! % javac -d /tmp test/files/run/t8442/{A,B}_1.java && qbin/scalac -classpath /tmp -d /tmp test/files/run/t8442/C_2.scala && (rm /tmp/A_1.class; true) && scalac-hash v2.10.0 -classpath /tmp -d /tmp test/files/run/t8442/C_2.scala warning: Class A_1 not found - continuing with a stub. warning: Caught: java.lang.NullPointerException while parsing annotations in /tmp/B_1.class two warnings found
| * | Merge pull request #3551 from xeno-by/topic/typecheck-member-defJason Zaugg2014-03-251-0/+15
| |\ \ | | | | | | | | [nomaster] backports 609047ba37
| | * | [nomaster] typecheck(q"class C") no longer crashesEugene Burmako2014-03-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemberDefs alone can't be typechecked as is, because namer only names contents of PackageDefs, Templates and Blocks. And, if not named, a tree can't be typed. This commit solves this problem by wrapping typecheckees in a trivial block and then unwrapping the result when it returns back from the typechecker. (cherry picked from commit 609047ba372ceaf06916d3361954bc949a6906ee)
* | | | Merge commit '876590b' into topic/merge-2.10.xJason Zaugg2014-05-081-4/+7
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-forward.whitelist.conf src/reflect/scala/reflect/runtime/JavaMirrors.scala
| * | | Merge pull request #3614 from retronym/ticket/8196Jason Zaugg2014-03-251-4/+7
| |\ \ \ | | |/ / | |/| | SI-8196 Runtime reflection robustness for STATIC impl details
| | * | SI-8196 Runtime reflection robustness for STATIC impl detailsJason Zaugg2014-03-111-4/+7
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala's runtime reflection works in few modes. The primary mode reads reads out the pickled signatures from ScalaSig annotations, if avaialable. However, these aren't available for Java-defined classes (obviously) nor for local Scala-defined classes (less obviously.), and the Scala `Symbol`s and `Types` must be reconstructed from the Java generic reflection metadata. This bug occurs in the last case, and is centered in `FromJavaClassCompleter`. In that completer, member fields and methods are given an owner based on the STATIC modifier. That makes sense for Java defined classes. I'm not 100% if it makes sense for Scala defined classes; maybe we should just skip them entirely? This patch still includes them, but makes the ownership-assignment more robust in the face of STATIC members emitted by the Scala compiler backend, such as the cache fields for structural calls. (It's reflection all the way down!). We might not have a companion module at all, so before we ended up owning those by `NoSymbol`, and before too long hit the dreaded NSDHNAO crash. That crash doesn't exist any more on 2.11 (it is demoted to a -Xdev warning), but this patch still makes sense on that branch. This commit makes `followStatic` and `enter` more robust when finding a suitable owner for static members. I've also factored out the duplicated logic between the two.
| * / [backport] SI-7902 Fix spurious kind error due to an unitialized symbolJason Zaugg2014-02-091-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tracked down this error: <none> is invariant, but type Y2 is declared covariant <none>'s bounds<notype> are stricter than type X2's declared bounds >: Nothing <: Any, <none>'s bounds<notype> are stricter than type Y2's declared bounds >: Nothing <: Any to `Symbol#typeParams` returning `List(NoSymbol)` if the symbol was not initialized. This happends in the enclosed test for: // checkKindBoundsHK() hkArgs = List(type M3) hkParams = List(type M2) This commit forces the symbol of the higher-kinded type argument before checking kind conformance. A little backstory: The `List(NoSymbol)` arises from: class PolyTypeCompleter... { // @M. If `owner` is an abstract type member, `typeParams` are all NoSymbol (see comment in `completerOf`), // otherwise, the non-skolemized (external) type parameter symbols override val typeParams = tparams map (_.symbol) The variation that triggers this problem gets into the kind conformance checks quite early on, during naming of: private[this] val x = ofType[InSeq] The inferred type of which is forced during: def addDerivedTrees(typer: Typer, stat: Tree): List[Tree] = stat match { case vd @ ValDef(mods, name, tpt, rhs) if !noFinishGetterSetter(vd) => // If we don't save the annotations, they seem to wander off. val annotations = stat.symbol.initialize.annotations (cherry picked from commit 03a06e02483eaf442158339c2edd6bcfd99847a3)
| * [nomaster] corrects an error in reify’s documentationEugene Burmako2014-01-261-5/+5
| |
| * [nomaster] SI-8146 Fix non-deterministic <:< for deeply nested typesJason Zaugg2014-01-151-25/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backported from master. This is a squashed commmit comprising: SI-8146 Pending test, diagnosis for bug in decidability of <:< (cherry picked from commit 8beeef339ad65f3308ece6fb0440cdb31b1ad404) SI-8146 Test cases for typechecking decidability Taken from "On Decidability of Nominal Subtyping with Variance" (Pierce, Kennedy), which was implemented in 152563b. Part of the implementation (SubTypePair) will be changed in the following commit to fix the non-deterministic errors typechecking heavily nested types involving aliases or annotations. (cherry picked from commit 2e28cf7f76c3d5fd0c2df4274f1af9acb42de699) SI-8146 Fix non-deterministic <:< for deeply nested types In the interests of keeping subtyping decidable [1], 152563b added some bookkeeping to `isSubType` to detect cycles. However, this was based on a hash set containing instances of `SubTypePair`, and that class had inconsistencies between its `hashCode` (in terms of `Type#hashCode`) and `equals` (in terms of `=:=`). This inconsistency can be seen in: scala> trait C { def apply: (Int @unchecked) } defined trait C scala> val intUnchecked = typeOf[C].decls.head.info.finalResultType intUnchecked: $r.intp.global.Type = Int @unchecked scala> val p1 = new SubTypePair(intUnchecked, intUnchecked) p1: $r.intp.global.SubTypePair = Int @unchecked <:<? Int @unchecked scala> val p2 = new SubTypePair(intUnchecked.withoutAnnotations, intUnchecked.withoutAnnotations) p2: $r.intp.global.SubTypePair = Int <:<? Int scala> p1 == p2 res0: Boolean = true scala> p1.hashCode == p2.hashCode res1: Boolean = false This commit switches to using `Type#==`, by way of the standard case class equality. The risk here is that you could find a subtyping computation that progresses in such a manner that we don't detect the cycle. It would need to produce an infinite stream of representations for types that were `=:=` but not `==`. If that happened, we'd fail to terminate, rather than judging the relationship as `false`. [1] http://research.microsoft.com/pubs/64041/fool2007.pdf (cherry picked from commit a09e143b7fd1c6b433386d45e9c5ae3548819b59) Conflicts: src/reflect/scala/reflect/internal/tpe/TypeComparers.scala src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
* | Merge pull request #3702 from gkossakowski/undoPairsGrzegorz Kossakowski2014-04-271-3/+10
|\ \ | | | | | | Use named class for UndoPair.
| * | Use named class for UndoPair.Grzegorz Kossakowski2014-04-251-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use specific, named class for UndoPair instead of generic Tuple2. This makes analysis of heap dumps much easier because profilers let you inspect memory consumption on per-class basis. The UndoPair case class is defined in companion object to not hold an outer pointer reference.
* | | SI-8478 Fix a performance regression in subtypingJason Zaugg2014-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking `M[X] <:< M[Y]` for an `M` with an invariant parameter, we have to check that `X <:< Y && Y <:< X`. This is done in `isSubArgs`. The compile time of that program in the ticket jumps from 20s in 2.10.4 to too-long-to-measure in 2.11.0. This commit reverts the a subtle change to `isSubArgs` in ea93654 that was ultimately responsible. The search for this was unusually circuitious, even for scalac. It appeared in 9c09c1709 due a tiny error that has since been reverted in 58bfa19. But 58bfa19 still exhibited abysmal performance, due to an intervening regression that I'm targeting here. I haven't managed to extract a performance test from Slick. Using the test that @cvogt provided, however, with this patch: % time qbin/scalac -J-Xmx4G -classpath /Users/jason/code/slick-presentation/target/scala-2.10/classes:/Users/jason/.sbt/0.13/staging/b64b71d1228cdfe7b6d8/slick/target/scala-2.10/classes:/Users/jason/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.6.4.jar /Users/jason/code/slick-presentation/src/main/scala/SlickPresentation.scala real 0m21.853s user 0m33.625s sys 0m0.878s Which is back to 2.10.x style performance.
* | | Merge pull request #3682 from retronym/ticket/8497Jason Zaugg2014-04-211-15/+16
|\ \ \ | | | | | | | | SI-8497 Fix regression in pickling of AnnotatedTypes
| * | | SI-8497 Fix regression in pickling of AnnotatedTypesJason Zaugg2014-04-141-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes an inconsistency introduced in these two spots: https://github.com/scala/scala/pull/3033/files#diff-6ce1a17ebee31068f41c36a8a2b3bc9aR79 https://github.com/scala/scala/pull/3033/files#diff-c455cb229f5227b1bcaa1544478fe3acR452 The bug shows up when pickling then unpickling an AnnotatedType that has only non-static annotations.
* | | | Merge pull request #3673 from retronym/ticket/8461Jason Zaugg2014-04-211-2/+4
|\ \ \ \ | |_|/ / |/| | | SI-8461 -Xsource:2.10 mode for macro signature checks
| * | | SI-8461 -Xsource:2.10 mode for macro signature checksJason Zaugg2014-04-041-2/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I can't get the test to fail in partest, so I've resorted to a manual test case. % qbin/scalac -nobootcp -Dscala.usejavacp=false -Xsource:2.10 -classpath $HOME/.m2/repository/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.jar:$HOME/.m2/repository/org/scala-lang/scala-reflect/2.10.3/scala-reflect-2.10.3.jar test/files/pos/t8461/Impl.scala warning: there were 1 deprecation warning(s); re-run with -deprecation for details one warning found % qbin/scalac -nobootcp -Dscala.usejavacp=false -Xsource:2.11 -classpath $HOME/.m2/repository/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.jar:$HOME/.m2/repository/org/scala-lang/scala-reflect/2.10.3/scala-reflect-2.10.3.jar test/files/pos/t8461/Impl.scala test/files/pos/t8461/Impl.scala:6: error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences def reads[A] = macro readsImpl[A] ^ one error found Before this change, when using a 2.10 JAR for scala-reflect, the macro signature validation checks failed. This was due to the fact that `scala.reflect.macros.Context` was changed in 2.11 to be a type alias. To get things working again, I've had to route both `defintions.{WhiteBoxContextClass, BlackBoxContextClass}` to the old location. This might mean that we misclassify the boxity under this mode. All that we can actually handle are blackbox macros, really, as macro expansion is likely to hit binary incompatibilites very quickly. We can refine this in subsequent releases.
* / / Update references to quasiquotes guideDenys Shabalin2014-04-032-5/+5
|/ /
* | Merge pull request #3657 from xeno-by/ticket/8388Jason Zaugg2014-03-283-48/+160
|\ \ | | | | | | SI-8388 consistently match type trees by originals