summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-7427 stop crashing under -Ydebug.Paul Phillips2013-05-192-19/+17
| | | | | | | | | | | | | | | | | Change "dumpClassesAndAbort" to "devWarning". You can witness it happen like so. % scalac test/files/pos/t7427.scala -Ydebug -Xdev ... [running phase cleanup on t7427.scala] [running phase icode on t7427.scala] warning: !!! PJUMP(method matchEnd4)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction warning: !!! PJUMP(method case6)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction [running phase inliner on t7427.scala] [running phase inlinehandlers on t7427.scala] Having now lived with this for months, I have no ambition to unravel the actual problem, I just want it to stop crashing.
* Merge 2.10.x into masterAdriaan Moors2013-05-177-17/+45
|\ | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Implicits.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala
| * Merge pull request #2540 from adriaanm/ticket-7201v2.10.2-RC1Adriaan Moors2013-05-174-1/+12
| |\ | | | | | | SI-7201 scala-library's pom points to scaladoc url
| | * SI-7201 scaladoc url in scala-(library,actors,swing,reflect) pomAdriaan Moors2013-05-174-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | The project/properties/info.apiURL pom property is used by SBT to link to an artifact's scaladoc. For scala library version $v, the url is http://www.scala-lang.org/api/$v/ Note that actors, reflect and swing are included in the library docs in 2.10.x.
| * | Merge pull request #2530 from kzys/jira-6424Adriaan Moors2013-05-171-9/+25
| |\ \ | | | | | | | | SI-6424 Scaladoc: Use mapNodes.get(_) to avoid NoSuchElementException
| | * | SI-6424 Scaladoc: Use mapNodes.get(_) to avoid NoSuchElementExceptionKato Kazuyoshi2013-05-151-9/+25
| | | | | | | | | | | | | | | | Use mapNodes.get(_) instead of mapNodes(_) to avoid NoSuchElementException.
| * | | Merge pull request #2549 from vigdorchik/slash_slashAdriaan Moors2013-05-171-4/+1
| |\ \ \ | | | | | | | | | | Prevent slash duplication.
| | * | | Prevent slash duplication.Eugene Vigdorchik2013-05-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Don't add trailing slash to external doc URL if it already ends with one.
| * | | | Merge pull request #2536 from adriaanm/ticket-7359Adriaan Moors2013-05-171-6/+11
| |\ \ \ \ | | | | | | | | | | | | [backport #1727] SI-7359 cyclic nested java class
| | * | | | [backport #1727] SI-7359 cyclic nested java classAdriaan Moors2013-05-161-6/+11
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original commit message (from 54a84a36d5): SI-6548 reflection correctly enters jinners When completing Java classes, runtime reflection enumerates their fields, methods, constructors and inner classes, loads them and enters them into either the instance part (ClassSymbol) or the static part (ModuleSymbol). However unlike fields, methods and constructors, inner classes don't need to be entered explicitly - they are entered implicitly when being loaded. This patch fixes the double-enter problem, make sure that enter-on-load uses the correct owner, and also hardens jclassAsScala against double enters that can occur in a different scenario.
| * | | | SI-7486 regression in implicit resolution.Paul Phillips2013-05-171-3/+7
| | |/ / | |/| | | | | | | | | | What a touchy beast the compiler is.
| * | | [nomaster] unbreaks test.bcEugene Burmako2013-05-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The optimizer behaves unexpectedly smartly, stripping off unused private methods. Unfortunately, sometimes private methods might be compiled down to public Java methods, so stripping them off might lead to binary incompatibilities. This particular commit recovers from this problem caused by https://github.com/scala/scala/commit/5e715396af.
* | | | Merge pull request #2555 from soc/SI-7492Adriaan Moors2013-05-173-217/+113
|\ \ \ \ | | | | | | | | | | SI-7492 Remove -Ystruct-dispatch and associated code
| * | | | SI-7492 Remove -Ystruct-dispatch and associated codeSimon Ochsenreither2013-05-173-217/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means that the private option is gone as well as the untested code for no-cache and mono-cache and the non-working code for invoke-dynamic. poly-cache is now always used. For the future it probably makes more sense to let the backend decide how it wants to treat structural dispatch instead of allowing the user to “mix and match” backends with structural dispatch implementations.
* | | | | Merge pull request #2518 from paulp/issue/1786Adriaan Moors2013-05-171-15/+40
|\ \ \ \ \ | | | | | | | | | | | | SI-1786 incorporate defined bounds in inference
| * | | | | No bounds-driven inference for the named.Paul Phillips2013-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a variation on the previous commit which excludes named type parameters, so this works def f(x: Class[_]) = x.foo.bar But this does not: def f[T](x: Class[T]) = x.foo.bar This seems undesirable to me, but I offer it in case it makes the patch more attractive to others.
| * | | | | SI-1786 incorporate defined bounds in inferencePaul Phillips2013-05-121-15/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fixes SI-5459. Look, you don't have to redeclare the bounds, isn't it exciting? For instance, there are eight places in JavaMirrors with this: jTypeVariable[_ <: GenericDeclaration] After this code is in starr, those can look like this: jTypeVariable[_] Since TypeVariable's definition looks like this: interface TypeVariable<D extends GenericDeclaration> We already know that!
* | | | | | Merge pull request #2541 from rjolly/scripting11Adriaan Moors2013-05-171-1/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | ScriptEngine.eval() forwards Error instead of new ScriptException
| * | | | | | ScriptEngine.eval() forwards Error instead of new ScriptExceptionRaphael Jolly2013-05-161-1/+9
| | | | | | |
* | | | | | | Merge pull request #2544 from ↵Adriaan Moors2013-05-174-31/+31
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | viktorklang/wip-normalize-parameter-names-in-scala-concurrent-2.11-√ Deprecate parameter names in scala.concurrent
| * | | | | | | Deprecate parameter names in scala.concurrentViktor Klang2013-05-164-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for the purpose of being consistent. Also switches to Future.successful iso Promise.successful(..).future for brevity in implementation code.
* | | | | | | | Merge pull request #2539 from soc/SI-7484Adriaan Moors2013-05-175-48/+31
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7484 Add @SupressWarning("rawtypes") to MainNode.java
| * | | | | | | | SI-7484 Indentation and whitespace fixesSimon Ochsenreither2013-05-175-51/+30
| | | | | | | | |
| * | | | | | | | SI-7484 Add @SupressWarning(rawtypes/unchecked)Simon Ochsenreither2013-05-173-0/+4
| | | | | | | | |
* | | | | | | | | Merge pull request #2538 from som-snytt/issue/6488-process-io-destroyAdriaan Moors2013-05-172-12/+20
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-6488 Interrupt i/o threads on process destroy
| * | | | | | | | | SI-6488 Interrupt i/o threads on process destroySom Snytt2013-05-152-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous fix uses Thread.stop to stop the threads which drain outputs, but should do something orderly. This commit interrupts the threads, which must check isInterrupted before attempting further i/o. The reading thread will suppress either the interruption or the IOException cited in the ticket. Similarly, i/o handlers must preserve and communicate interrupted status. The modest goal of this fix is to ameliorate any stack traces when the process is destroyed. The test runs itself as a sample process with output.
* | | | | | | | | | Merge pull request #2554 from paulp/merge/v2.10.1-326-g4f8c306-to-masterAdriaan Moors2013-05-1729-1260/+2140
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Merge v2.10.1-326-g4f8c306 into master
| * \ \ \ \ \ \ \ \ \ Merge v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-masterJason Zaugg2013-05-171595-70491/+32221
| |\ \ \ \ \ \ \ \ \ \ | | | |/ / / / / / / / | | |/| | | | | / / / | | |_|_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ================================================================ Merge commit 'v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala ================================================================ Merge -s ours 4e64a27 ([nomaster commit range]) ================================================================ Merge commit '0ae7e55' into merge/v2.10.1-326-g4f8c306-to-master Conflicts: src/compiler/scala/tools/nsc/typechecker/Macros.scala
| * | | | | | | | | Merge pull request #2504 from scalamacros/ticket/7464Jason Zaugg2013-05-172-4/+4
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7464 allows FieldMirror.set to update vals
| | * | | | | | | | | SI-7464 allows FieldMirror.set to update valsEugene Burmako2013-05-172-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to leave such sentinels in place inside a facility designed to circumvent usual restrictions of static types / visibility.
| * | | | | | | | | | Merge pull request #2497 from scalamacros/topic/macro-qqqJason Zaugg2013-05-173-21/+33
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | easy way of writing not implemented macros
| | * | | | | | | | | | easy way of writing not implemented macrosEugene Burmako2013-05-123-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though it's easy to mark regular method bodies as stubs (using ???), there's no simple way of doing the same for macro methods. This patch fixes the inconvenience.
| * | | | | | | | | | | Fix for unreachable code warning.Paul Phillips2013-05-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Oops, I miss when unreachable code was an error.
| * | | | | | | | | | | Merge pull request #2537 from adriaanm/ticket-5886Paul Phillips2013-05-161-22/+1
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | SI-5886 Remove check for packed type conformance.
| | * | | | | | | | | | | SI-5886 Remove check for packed type conformance.Jason Zaugg2013-05-151-22/+1
| | | |_|_|_|_|_|_|_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing breaks. Why did by-name arguments have this extra check? What's the difference to a () => T? The check was added originally in 8414eba.
| * | | | | | | | | | | Merge pull request #2515 from heathermiller/issue/6555Adriaan Moors2013-05-151-7/+10
| |\ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / | |/| | | | | | | | | | Actual SI-6555 fix, Scaladoc filter works now WITH keyboard shortcuts too
| | * | | | | | | | | | Actual SI-6555 fix, Scaladoc filter works WITH keyboard shortcuts tooHeather Miller2013-05-121-7/+10
| | | |_|_|_|_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit daefab18b8b0c170c372991022357413ec69b2af attempted to fix a bug related to Scaladoc filtering, meanwhile breaking Scaladoc keyboard shortcuts. Before commit daefab18b8b0c170c372991022357413ec69b2af, Scaladoc's filter wouldn't consider the last character of a search term entered into the (left) Scaladoc filter pane, but toggling with the `tab` key between filter panes did work. After daefab18b8b0c170c372991022357413ec69b2af, Scaladoc's left pane filter correctly searches for the full search term, but pressing the `tab` key causes the "focus" of the input bar to be stuck on the filter panel in the right Scaladoc filter pane, rendering it useless. End result: annoying Scaladoc interface bug present in 2.10.1, but which wasn't present in 2.10.0. This pull request fixes this, enabling both behaviors. The `tab` key toggle needed to be triggered on a `keydown` event (currently it's not), while everything else is fine to be triggered on a `keyup` event. This pull request enables the correct behavior by binding both a `keydown` and a `keyup` event rather than lumping everything all together in a `keyup` event (as was the case before).
| * | | | | | | | | | Merge pull request #2502 from ↵Adriaan Moors2013-05-141-1/+1
| |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | viktorklang/wip-SI7383-EC-prepare-in-Future-apply-2.10-√ SI-7383 - call ExecutionContext.prepare in Future.apply
| | * | | | | | | | | SI-7383 - Call ExecutionContext.prepare in Future.apply to allow for ↵Viktor Klang2013-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | capturing local context like ThreadLocals and then re-establishing them prior to execution, as per intention of EC.prepare
| * | | | | | | | | | Merge pull request #2500 from phaller/topic/forkjoin-updateJason Zaugg2013-05-123-1084/+1897
| |\ \ \ \ \ \ \ \ \ \ | | |_|/ / / / / / / / | |/| | | | | | | | | SI-7442 Update bundled Fork/Join pool (JSR166y)
| | * | | | | | | | | SI-7442 Update bundled Fork/Join pool (JSR166y)Philipp Haller2013-05-113-1084/+1897
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Updates ForkJoinPool and dependent classes to the latest jsr166y revisions: ForkJoinPool.java: Revision 1.185 Sat Feb 16 20:50:29 2013 UTC (2 months, 2 weeks ago) by jsr166 ForkJoinTask.java: Revision 1.100 Tue Feb 5 17:09:54 2013 UTC (3 months ago) by jsr166 ForkJoinWorkerThread.java: Revision 1.73 Wed Nov 21 19:54:39 2012 UTC (5 months, 2 weeks ago) by dl - Includes Akka-contributed `sun.misc.Unsafe` detection to support Android. See changeset 06d685c1bbd8a0d058ee8a3f374569f8097f2acc - Adds private `CountedCompleter` class. This class is only visible and used in `ForkJoinPool.java`. - Updates desired.sha1 for updated forkjoin.jar. - Updates binary compatibility whitelists to exclude package-private methods in the `forkjoin` package. - Also fixes SI-7438.
| * | | | | | | | | | Merge pull request #2494 from scalamacros/ticket/5923Eugene Burmako2013-05-1114-71/+258
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | makes sense of implicit macros!
| | * | | | | | | | | | [nomaster] removes duplication in inferImplicitValueEugene Burmako2013-05-113-50/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shame-driven development at its best.
| | * | | | | | | | | | [nomaster] SI-7166 catches DivergentImplicit in c.inferImplicitXXXEugene Burmako2013-05-112-20/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite inferImplicit usually being nice and buffering errors, apparently it can also throw DivergentImplicit exception. This patch catches it and only reports it if silent is set to false. NOTE: we no longer have the DivergentImplicit exception in master, so this commit only makes sense in 2.10.x.
| | * | | | | | | | | | [nomaster] SI-7047 fixes silent for c.inferImplicitXXXEugene Burmako2013-05-112-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | silent = true now throws a TypecheckException even if we don't know why an implicit search has failed (i.e. if context.hasErrors is false). NOTE: this commit is a part of a pull request for 2.10.x, which makes sense of implicit macros. Everything in that pull request is [nomaster] due to one reason or another. This commit would work equally well in both 2.10.x and master, but I'm marking it as [nomaster] as well, because I'm anyway going to resubmit the whole pull request into master soon, so there's no reason to introduce additional confusion.
| | * | | | | | | | | | [nomaster] SI-7291: No exception throwing for diverging implicit expansionHubert Plociniczak2013-05-115-13/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we don't throw exceptions for normal errors it was a bit odd that we don't do that for DivergingImplicit. As SI-7291 shows, the logic behind catching/throwing exception was broken for divergence. Instead of patching it, I rewrote the mechanism so that we now another SearchFailure type related to diverging expansion, similar to ambiguous implicit scenario. The logic to prevent diverging expansion from stopping the search had to be slightly adapted but works as usual. The upside is that we don't have to catch diverging implicit for example in the presentation compiler which was again showing that something was utterly broken with the exception approach. NOTE: This is a partial backport of https://github.com/scala/scala/pull/2428, with a fix for SI-7291, but without removal of error kinds (the former is absolutely necessary, while the latter is nice to have, but not a must, therefore I'm not risking porting it to 2.10.x). Also, the fix for SI-7291 is hidden behind a flag named -Xdivergence211 in order not to occasionally break the code, which relies on pre-fix behavior.
| | * | | | | | | | | | [nomaster] SI-7167 implicit macros decide what is divergenceEugene Burmako2013-05-117-16/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Imagine a macro writer which wants to synthesize a complex implicit Complex[T] by making recursive calls to Complex[U] for its parts. E.g. if we have `class Foo(val bar: Bar)` and `class Bar(val x: Int)`, then it's quite reasonable for the macro writer to synthesize Complex[Foo] by calling `inferImplicitValue(typeOf[Complex[Bar])`. However if we didn't insert `info.sym.isMacro` check in `typedImplicit`, then under some circumstances (e.g. as described in http://groups.google.com/group/scala-internals/browse_thread/thread/545462b377b0ac0a) `dominates` might decide that `Bar` dominates `Foo` and therefore a recursive implicit search should be prohibited. Now when we yield control of divergent expansions to the macro writer, what happens next? In the worst case, if the macro writer is careless, we'll get a StackOverflowException from repeated macro calls. Otherwise, the macro writer could check `c.openMacros` and `c.openImplicits` and do `c.abort` when expansions are deemed to be divergent. Upon receiving `c.abort` the typechecker will decide that the corresponding implicit search has failed which will fail the entire stack of implicit searches, producing a nice error message provided by the macro writer. NOTE: the original commit from macro paradise also introduced a new class, which encapsulates information about implicits in flight. Unfortunately we cannot do that in 2.10.x, because of binary compatibility concerns, therefore I'm marking this commit as [nomaster] and will be resubmitting its full version in a separate pull request exclusively targetting master.
| | * | | | | | | | | | [nomaster] macroExpandAll is now triggered in all invocations of typedEugene Burmako2013-05-112-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | macroExpandAll is the key player in the mechanism of expanding macros after their type arguments have been inferred. (Macro applications that contain yet uninferred type arguments don't get expanded and are delayed until the targs are inferred. Therefore later on we need to trigger those delayed expansions manually, which is done by macroExpandAll). Previously macroExpandAll was only called from a few selected places in the typechecker, but that's quite risky, since typer evolves, and who knows when this scheme breaks. To make things more robust, I'm now calling macroExpandAll in the epilogue of every single call to `typed`. Don't worry - this shouldn't impose noticeable performance penalties, since the call is guarded by a branch upon a plain boolean field. NOTE: This patch is a second take on fixing implicit macros, with the first one being a backport from macro paradise merged into master in January 2013: https://github.com/scala/scala/commit/fe60284769. The original fix had an unfortunate error, as described on scala-internals: https://groups.google.com/forum/#!msg/scala-internals/7pA9CiiD3u8, so I had to refine the approach here. This means that it's not possible to directly merge this commit into master, so I'm marking it as [nomaster] and will submit a separate pull request targetting master later on.
| | * | | | | | | | | | [nomaster] SI-5923 instantiates targs in deferred macro applicationsEugene Burmako2013-05-113-11/+61
| | |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amazingly enough, the fix for the "macro not expanded" problem was super easy. (And I remember spending a day or two trying to find a quick fix somewhen around Scala Days 2012!) The problem was in the implementation of the macro expansion trigger, which was buried in a chain of if-elif-elif in `adapt`. This meant that macro expansion was mutually exclusive with a lot of important adaptations, e.g. with `instantiate`. More precisely, if an expandee contains an undetparam, its expansion should be delayed until all its undetparams are inferred and then retried later. Sometimes such inference can only happen upon a call to instantiate in one of the elif's coming after the macro expansion elif. However this elif would never be called for expandees, because control flow would always enter the macro expansion branch preceding the inference branch. Therefore `macroExpand` now takes the matters in its own hands, calling `instantiate` if the expansion has been delayed and we're not in POLYmode (see a detailed explanation in a comment to `macroExpand`). Consequences of this fix are vast. First of all, we can get rid of the "type parameter must be specified" hack. Secondly and most importantly, we can now remove the `materializeImplicit` method from Implicits and rely on implicit macros to materialize tags for us. (This is a tricky change, and I'll do it later after we merge as much of my pending work as possible). Finally, we learn that the current scheme of interaction between macros, type inference and implicits is, in principle, sound! NOTE: This patch is a second take on fixing implicit macros, with the first one being a backport from macro paradise merged into master in January 2013: https://github.com/scala/scala/commit/fe60284769. The original fix had an unfortunate error, as described on scala-internals: https://groups.google.com/forum/#!msg/scala-internals/7pA9CiiD3u8, so I had to refine the approach here. This means that it's not possible to directly merge this commit into master, so I'm marking it as [nomaster] and will submit a separate pull request targetting master later on.
| * | | | | | | | | | Merge pull request #2496 from igormoreno/2.10.xPaul Phillips2013-05-111-1/+1
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Scaladoc: fixing small typo in PartialFunction.scala