summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | transformers no longer ignore UnApply.funEugene Burmako2013-09-262-26/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Second time's the charm. I remember trying to do exactly the same somewhen around 2.10.0-M4, but then some continuations tests were failing. Luckily, today everything went smoothly. Please note that this fix changes the way that SI-5465 manifests itself. Previously it produced type errors, now it simply crashes the compiler. Therefore I had to attach the try/catch FatalError clause to invocations of toolbox methods, so that compiler crashes get caught and translated to ToolBoxErrors. Also fixes SI-7871, and that clears the way for implementing quasiquotes with conventional macros rather than relying on a special case in typer.
* | | | | | Some refinement of -Xlint interpolation warning.Paul Phillips2013-09-272-43/+41
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had covered a few more cases working on this recently. The warnings in several more cases involving polymorphism, currying, and selects vs. idents receive more refined handling.
* | | | | Merge pull request #2909 from soc/SI-7629-deprecate-view-boundsJason Zaugg2013-09-271-4/+6
|\ \ \ \ \ | | | | | | | | | | | | SI-7629 Deprecate view bounds
| * | | | | SI-7629 Deprecate view boundsSimon Ochsenreither2013-09-251-4/+6
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a warning(/error with -Xfuture) with a general migration advice. The IDE can use the warning to offer a quick fix with the specific refactoring necessary.
* | | | | Merge pull request #2992 from retronym/ticket/7877Jason Zaugg2013-09-272-2/+3
|\ \ \ \ \ | | | | | | | | | | | | Only look for unapplies in term trees
| * | | | | SI-7877 Only look for unapplies in term treesJason Zaugg2013-09-272-2/+3
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Scala 2.10.2, the enclosed test case has crashed in the backend. Before, we correctly rejected this pattern match. My bisection landed at a merge commit f16f4ab157, although both parents were good. So I don't quite trust that. I do think the regression stems from the changes to allow: case rx"AB(.+)" => Examples of this are in run/t7715.scala. This commit limits the search for extractors to cases where the function within the Apply is a term tree.
* | | | | Merge pull request #2978 from som-snytt/issue/7848-forgotten-interp-msg-lgtmPaul Phillips2013-09-274-27/+35
|\ \ \ \ \ | | | | | | | | | | | | SI-7848 Xlint no warn on $sym with params
| * | | | | SI-7848 Xlint no warn on $sym with paramsSom Snytt2013-09-234-27/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This idea brought to you by retronym. Also improve implicitNotFound detection at typer; and avoid checking the standard interpolation expression for cases like s"some $$x". Some minor refactorings of implicitNotFound strings. The intersobralator allows extra spaces, i.e., trims.
* | | | | | Merge pull request #2996 from paulp/pr/3971Jason Zaugg2013-09-272-1/+14
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-3971 error message carat mispoints at curried methods.
| * | | | | | SI-3971 error message carat mispoints at curried methods.Paul Phillips2013-09-272-1/+14
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Point at the beginning of the first argument list when reporting an error, as this is most easily associated with the application taking place (which may involve multiple applies in succession.) Thanks to retronym for figuring out why issuing a better error message broke the compiler on non-erroneous compile runs. The changes to "treesInResult" are the consequence.
* | | | | | Merge pull request #2998 from paulp/pr/6120Paul Phillips2013-09-271-7/+18
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6120 multiple warnings at same position.
| * | | | | | SI-6120 multiple warnings at same position.Paul Phillips2013-09-271-7/+18
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | An error suppresses all further warnings at the same position, but multiple warnings can be heard.
* | | | | | Merge pull request #2987 from paulp/pr/emptySelfTypePaul Phillips2013-09-2723-52/+50
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6762 rename emptyValDef to emptySelfType.
| * | | | | | SI-6762 rename emptyValDef to noSelfType.Paul Phillips2013-09-2723-52/+50
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | Looks like emptyValDef.isEmpty was already changed to return false, so now all that's left is a name which means something.
* | | | | | Merge pull request #2995 from paulp/pr/defaultparamJason Zaugg2013-09-276-14/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix up DEFAULTPARAM semantics.
| * | | | | | Fix up DEFAULTPARAM semantics.Paul Phillips2013-09-276-14/+15
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I foolishly believed the deprecation message on "hasDefaultFlag" which suggested I use "hasDefault" instead. After lots of head scratching, I hardened the semantics so it's like this: - A method parameter with a default value is PARAM | DEFAULTPARAM - A default getter for such a parameter is METHOD | DEFAULTPARAM - And "hasDefault" is has(DEFAULTPARAM) && has(PARAM | METHOD) Why all the bonus logic, why not just hasFlag(DEFAULTPARAM)? For some reason we have a handful of overloaded flags spanning uses which someone apparently thinks can never intersect but I have not been so lucky overall. So since DEFAULTPARAM is overloaded with TRAIT, unless we think it's fine that default getters and method parameters with defaults will pose as traits all the time, there has to be an anchor bit alongside it.
* | | | | | Merge pull request #2963 from sjrd/topic/hooks-for-scala-jsAdriaan Moors2013-09-272-4/+17
|\ \ \ \ \ \ | | | | | | | | | | | | | | Small refactorings giving hooks for Scala.js
| * | | | | | Move logic checking valid names from ClassPath to ClassPathContextSébastien Doeraene2013-09-231-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other methods taking the same kind of decisions were already in ClassPathContext, e.g., isValidName() or, in some sense, even toBinaryName(). This makes ClassPath itself be completely agnostic of how particular kinds of files or directories are named. It also allows to override this logic at the context level. Without it, overriding this logic required a fair amount of code duplication from ClassPath.
| * | | | | | Add back the newClassLoader hook in SymbolLoaders.Sébastien Doeraene2013-09-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was previously an overridable method of Platform. The loader creation was moved in afbee09c8e0e7b1a4da1f8517c723dad9f1adb6f directly in SymbolLoaders, but inside a method doing more logic, namely initializeFromClassPath(). This commit simply moves the actual creation of the class loader (`new ClassfileLoader(bin)`) into its own method `newClassLoader`, but in SymbolLoaders. This allows to override only that method in subclasses of SymbolLoaders.
* | | | | | | Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-master-2Jason Zaugg2013-09-275-11/+11
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf build.xml src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/library/scala/concurrent/Future.scala src/reflect/scala/reflect/internal/Types.scala
| * | | | | | Merge remote-tracking branch 'origin/2.10.3' into merge/2.10.3-to-2.10.xJason Zaugg2013-09-241-7/+4
| |\ \ \ \ \ \
| | * | | | | | SI-7861 Don't execute internal callbacks on the user ExecutorJason Zaugg2013-09-211-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callbacks internal to the implementation of Futures should be executed with the `InternalCallbackExecutor`, rather than the user supplied `Executor`. In a refactoring da54f34a6, `recoverWith` and `flatMap` no longer played by these rules. This was noticed by a persnickety test in Play. Before this patch, the enclosed test outputs: % scala-hash v2.10.3-RC2 test/files/run/future-flatmap-exec-count.scala mapping execute() flatmapping execute() execute() recovering execute() execute()
| * | | | | | | Merge pull request #2919 from retronym/ticket/7815Jason Zaugg2013-09-231-2/+2
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | SI-7815 Dealias before deeming method type as dependent
| | * | | | | | SI-7815 Dealias before deeming method type as dependentJason Zaugg2013-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable eta-expansion of method types seen from a prefix that renders the result type as independent from the parameter symbols. The enclosed test shows that we dealias types before checking dependence, and that we do this deeply (e.g. type arguments are also dealised.) An existing test, neg/error_dependentMethodTpeConversionToFunction, confirms that bona-fide dependent methods are still prohibited from eta expansion.
| * | | | | | | Merge pull request #2923 from retronym/ticket/7825Grzegorz Kossakowski2013-09-112-2/+5
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7825 Consider DEFAULTMETHOD when refchecking concreteness
| | * | | | | | | SI-7825 Consider DEFAULTMETHOD when refchecking concretenessJason Zaugg2013-09-102-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A class should not be required to implement a Java default method. This commit uses `isDeferredNotDefault` in place of `isDeferred` when finding unimplemented methods. The test itself does not depend on Java 8 as we use scalac's Java source parser to set things up.
* | | | | | | | | Merge pull request #2979 from retronym/ticket/7870Jason Zaugg2013-09-261-3/+5
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7870 Detect default getter clashes in constructors
| * | | | | | | | | SI-7870 Detect default getter clashes in constructorsJason Zaugg2013-09-231-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default getters for constructors live in the companion module. These eluded the check for clashes in default getter names due to overloading, which aims to give a more user friendly error than "double definition: meth$default$1". This commit checks for default getters in the companion module, in addition to those in the template itself.
* | | | | | | | | | Merge pull request #2990 from retronym/ticket/7876Jason Zaugg2013-09-262-6/+6
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Scaladoc regression with Function / Tuple type constructors
| * | | | | | | | | | SI-7876 Less dealiasing in Scaladoc's type printing.Jason Zaugg2013-09-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scaladoc renders tuple and function types with the syntactic sugar. To do so, it was using `isFunctionType` and `isTupleType`. Internally, these methods dealias, so one can't simply take the type arguments from the given type to get the element types of the tuple. In ac96200c92, a Scaladoc crasher in this area was resolved by normalizing a type before extracting Tuple type arguments. Similar code already existed in the handling of FunctionTypes. This commit goes in the opposite direction, and instead queries the `direct` versions of those methods, which do not perform dealiasing. Conseqeuently, the type aliases that appear in the source code signatures for members will be rendered as such in Scaladoc. Which seems like an improvement.
| * | | | | | | | | | SI-7876 Scaladoc crasher due to regression in isFunctionType.Jason Zaugg2013-09-261-2/+2
| | |_|_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `isFunctionType` and `isTupleType` started returing true for type constructors as of aeb73314. This led to a crash in type printing in ScalaDoc (specfically, in ModelFactoryTypeSupport.scala) This commit: - fixes those methods by guarding with !isHigherKinded - unit tests said methods - tests the reported crasher with a ScalaDoc test.
* / | | | | | | | | Remove octal escape literals from the codebaseSimon Schaefer2013-09-254-25/+25
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Octal escape literals are deprecated and will be removed in the next Scala version.
* | | | | | | | | Merge pull request #2982 from retronym/topic/checkinitAdriaan Moors2013-09-241-0/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-4742 Make -Xcheckinit aware of constants.
| * | | | | | | | | SI-4742 Make -Xcheckinit aware of constants.Jason Zaugg2013-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Members defined as `final val x = <literal>` are given a ConstantType. The constant is folded into the accessor method `x`, and the field itself is never initialized. (Related discussion: SI-4605) As such, -Xcheckinit spuriously warns when calling that accessor. This commit disables the checks for constants. This will also fix the checkinit build (failure tracked as SI-7839), which is the victim of this a spurious scolding.
* | | | | | | | | | Merge pull request #2980 from huitseeker/revert-2957Jason Zaugg2013-09-246-286/+305
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | Revert #2957
| * | | | | | | | | Revert "Merge pull request #2957 from paulp/pr/parser-improvements"François Garillot2013-09-246-286/+305
| | |_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 884e1ce762d98b29594146d37b85384581d9ba96, reversing changes made to f6fcc4431f272c707d49de68add532c452dd4b0f.
* | | | | | | | | Merge pull request #2975 from retronym/ticket/7868Jason Zaugg2013-09-232-4/+13
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | SI-7868 Account for numeric widening in match translation
| * | | | | | | | SI-7868 Account for numeric widening in match translationJason Zaugg2013-09-232-4/+13
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pattern match translation was unprepared for trees of the shape: (0: Short) match { case A.unapply(<unapply-selector>.toInt) <unapply> (_) => () case _ => () } While a scrutinee is inelibigle for implicit views in order to conform to the type of the extractor call, it is allowed to weakly conform. In this case, the typechecker will add the numeric widening with a `toInt` call. This commit: - Changes treeInfo.Unapplied to recognize this tree shape - Changes spliceApply to recognize and preserve the widening when substituting the unapply selector with the binder - Tests reification of such pattern matches, which also depends on treeInfo.Unapplied.
* | | | | | | | Merge pull request #2938 from Ichoran/issue/7725Jason Zaugg2013-09-231-3/+26
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7725 - Vector concatenation is unreasonably slow
| * | | | | | | | SI-7725 - Vector concatenation is unreasonably slowRex Kerr2013-09-201-3/+26
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrote ++ to use append or prepend when adding small collections to the end or beginning of vectors. This solves the extra-O(n) problem for addition of single elements reported in SI_7725. Renamed LgConcatFaster to Log2ConcatFaster (more widely recognizable).
* | | | | | | | Merge pull request #2956 from som-snytt/issue/7848-forgotten-interp-msgJason Zaugg2013-09-231-8/+19
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7848 Xlint says what looks interpolated
| * | | | | | | | SI-7848 Xlint no warn on $sym with paramsSom Snytt2013-09-181-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This idea brought to you by retronym.
| * | | | | | | | SI-7855 No missing interpolator warning post-typerSom Snytt2013-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid extra work, extra warnings.
| * | | | | | | | SI-7848 Xlint says what looks interpolatedSom Snytt2013-09-171-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivating use case was an Expecty debug string getting flagged for `$eq`. The test case demonstrates a different bug, in which the position of the literal tree is changed when typer gets rid of the unused local, so that when the tree is re-typed in erasure, a second, spurious warning is emitted at the start of the method. Specifically, the second warning is not suppressed because of the different position.
* | | | | | | | | Merge pull request #2953 from jiaweihli/masterJason Zaugg2013-09-231-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix typo in documentation.
| * | | | | | | | | Fix typo in documentation.Jiawei Li2013-09-161-1/+1
| |/ / / / / / / /
* | | | | | | | | Merge pull request #2962 from densh/topic/syntactic-assignJason Zaugg2013-09-237-14/+32
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Quasiquotes: add syntactic extractor for assignment-like trees
| * | | | | | | | | add syntactic extractor for assignment-like treesDen Shabalin2013-09-187-14/+32
| | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three kinds of assign-like trees: 1. Assign(lhs, rhs) // $lhs = $rhs 3. AssignOrNamedArg(lhs, rhs) // $lhs = $rhs 2. Apply(Select(f, nme.update), args :+ rhs) // $f(..$args) = $rhs New syntactic combinator unifies all of them and lets users not to think about these implementations details.
* | | | | | | | | Merge pull request #2968 from huitseeker/interrupt-koshernessJason Zaugg2013-09-231-2/+8
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Follow good interrupt discipline in Response
| * | | | | | | | | Follow good interrupt discipline in ResponseFrançois Garillot2013-09-201-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restores the interrupted status of the waiting thread after catching an InterruptException.