summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-6184 don't introduce dummies in checkableTypeAdriaan Moors2012-08-092-18/+22
| | | | | | | this should fix the crash in asSeenFrom that resulted from calling baseTypeSeq on a type that had an unbound type parameter in it also, simplify widenToClass
* Merge pull request #1060 from adriaanm/ticket-5739bAdriaan Moors2012-08-084-47/+170
|\ | | | | SI-5739 (bis) vals for subpatterns when -g:patmatvars
| * SI-5739 (bis) vals for subpatterns unless -optimizeAdriaan Moors2012-08-084-47/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To facilitate debugging pattern matches, we store the values for sub-patterns of extractor (synthetic or user-defined) patterns in local variables. When performing an optimized build, and when possible, we don't do store but inline them directly. For soundness, SI-5158, SI-6070, we must always store the values of mutable case class fields. (Specifying -optimize is the only way to suppress emitting these local variables. An unoptimized build will always generate them, which was deemed the right default during the meeting.) (updated flags for t4425 to get consistent runs on optimized and non-optimized partest runs by always passing -optimize)
* | Merge pull request #1088 from adriaanm/ticket-6205Adriaan Moors2012-08-082-3/+22
|\ \ | | | | | | SI-6205 make pt fully defined before inferTypedPattern
| * | SI-6205 make pt fully defined before inferTypedPatternAdriaan Moors2012-08-082-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | refines my fix for SI-2038 (#981) by making pt fully defined before calling inferTypedPattern, instead of making the result of inferTypedPattern fully defined I finally realized my mistake by diffing the -Ytyper-debug output of compiling the variants with: ``` x match {case Holder(k: A[kt]) => (k: A[kt])} ``` and ``` (x: Any) match {case Holder(k: A[kt]) => (k: A[kt])} ```
* | | Merge pull request #1064 from adriaanm/ticket-6145Adriaan Moors2012-08-083-12/+35
|\ \ \ | | | | | | | | SI-6145 lax typing of args to synthetic case-labels
| * | | SI-6145 lax typing of args to synthetic case-labelsAdriaan Moors2012-08-073-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use wildcard for the expected type of the arguments of a jump to a label synthesized by the pattern matcher... except during erasure: we must take the expected type into account as it drives the insertion of casts! It's ok since we're typing the translation of well-typed code. The only "type errors" we catch are skolem mismatches. (after erasure the existential types that before caused problems have disappeared.) It's necessary to balance GADT magic, SI-6145, CPS type-driven transforms and other existential trickiness. I've exhausted all other semi-clean approaches I could think of: - the right thing to do -- packing existential types -- runs into limitations in subtyping existential types, - casting breaks SI-6145 (and it's an unnecessary cast at run time), - not casting breaks GADT typing as it requires sneaking ill-typed trees past typer
* | | | Merge pull request #1087 from hubertp/2.10.x-issue/5687Adriaan Moors2012-08-083-1/+72
|\ \ \ \ | | | | | | | | | | Fixes SI-5687.
| * | | | Fixes SI-5687.Hubert Plociniczak2012-08-083-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | | Recover from erroneous type alias override to report more useful error message.
* | | | | Merge pull request #1073 from adriaanm/ticket-6183Adriaan Moors2012-08-081-2/+3
|\ \ \ \ \ | | | | | | | | | | | | SI-6183 don't crash on type error in outer test
| * | | | | SI-6183 don't crash on type error in outer testAdriaan Moors2012-08-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unfortunately without test case since the report was hard to minimize since it was a crash on erroneous code, I figured a backstop against a crash should suffice
* | | | | | Merge pull request #1056 from heathermiller/try-based-futuresAdriaan Moors2012-08-0812-349/+327
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | Bases futures on Try instead of Either
| * | | | | Fix test for ExecutionContext.preparephaller2012-08-081-1/+1
| | | | | |
| * | | | | Doc fix on exec ctx prepare method, fix to testsHeather Miller2012-08-084-4/+6
| | | | | |
| * | | | | Added tests, removal of unnecessary methods, fixes prepareHeather Miller2012-08-075-29/+27
| | | | | |
| * | | | | Merge branch 'try-based-futures' of https://github.com/heathermiller/scala ↵Heather Miller2012-08-053-3/+78
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into try-based-futures
| | * | | | | SI-6185 - add "prepare" hook to ExecutionContextphaller2012-08-053-3/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables important abstractions to be built on top of futures, such as Twitter's "Local" for handling data local to a callback chain.
| * | | | | | Temporarily skips failing test due to optimizer bug SI-6188Heather Miller2012-08-052-6/+6
| |/ / / / / | | | | | | | | | | | | | | | | | | Also swaps the arguments to method transform on Try, so as to mirror transform on scala.concurrent.Future.
| * | | | | Basing Futures on Try instead of EitherHeather Miller2012-08-0411-332/+235
| | | | | |
* | | | | | Merge pull request #1079 from scalamacros/ticket/5947Adriaan Moors2012-08-0823-31/+611
|\ \ \ \ \ \ | | | | | | | | | | | | | | reflection now correctly supports inner classes and modules
| * | | | | | SI-5947 works around getDeclaredClassesEugene Burmako2012-08-0821-11/+597
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our name mangling scheme w.r.t stuff nested into objects conflicts with JVM's ideas of beauty, which messes up getDeclaredClasses. Scala reflection needs getDeclaredClasses to convert between Scala and Java, so the situation looked grim. Greg suggested a workaround described in: https://issues.scala-lang.org/browse/SI-4023?focusedCommentId=54759#comment-54759. Luckily the workaround worked!
| * | | | | | SI-5498 completes ModuleMirror.instanceEugene Burmako2012-08-074-22/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per referenced issue, this patch implements `instance` for ModuleMirrors corresponding to nested and inner modules.
* | | | | | | Merge pull request #1075 from adriaanm/ticket-6040Adriaan Moors2012-08-087-3/+28
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | SI-6040 error on unauthorized extension Dynamic
| * | | | | | SI-6040 error on unauthorized extension DynamicAdriaan Moors2012-08-087-3/+28
| | |_|/ / / | |/| | | | | | | | | | | | | | | | authorization is easy to get: `import language.dynamics`
* | | | | | Merge pull request #1043 from magarciaEPFL/fixes210Adriaan Moors2012-08-081-7/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | updating resolveDups() to use MethodTFA.mutatingInterpret()
| * | | | | | updating resolveDups() to use MethodTFA.mutatingInterpret()Miguel Garcia2012-08-021-7/+2
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #1084 from VladUreche/issue/5933Adriaan Moors2012-08-083-2/+46
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-5933 do the new patmat translation for scaladoc …
| * | | | | | SI-5933 testcase for Adriaan's pullreq #980Vlad Ureche2012-08-072-0/+44
| | | | | | |
| * | | | | | SI-5933 do the new patmat translation for scaladocAdriaan Moors2012-08-071-2/+2
| | |_|/ / / | |/| | | | | | | | | | | | | | | | especially because it benefits from nicer type inference for partial functions
* | | | | | Merge pull request #1085 from gkossakowski/inline-in-constructorsAdriaan Moors2012-08-076-1/+40
|\ \ \ \ \ \ | | | | | | | | | | | | | | Enable inlining in constructors.
| * | | | | | Enable inlining in constructors.Grzegorz Kossakowski2012-08-076-1/+40
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inlining in constructors has been disabled a long time ago due to some VerifyErrors. Unfortunately, @dragos cannot recall what exactly was the problem. I tried to enable inlining in constructors and I didn't see any problem. `Predef.assert` calls in class constructors are one of the biggest contributors to closure allocation in a compiler so we better off get rid of it. Added a test-case that checks if inlining in constructors works properly. Review by @magarciaEPFL and @paulp.
* | | | | | Merge pull request #1080 from scalamacros/ticket/6186Josh Suereth2012-08-0735-73/+69
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6186 TypeTags no longer supported in macros
| * | | | | | SI-6186 TypeTags no longer supported in macrosEugene Burmako2012-08-0735-73/+69
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original idea was to support both both TypeTags and ConcreteTypeTags as context bounds on macro implementations. Back then TypeTags were the implied default flavor of type tags. Basically because "TypeTag" is shorter than "ConcreteTypeTag" everyone jumped onto them and used them everywhere. That led to problems, because at that time TypeTags could reify unresolved type parameters ("unresolved" = not having TypeTag annotations for them). This led to a series of creepy errors, when one forgets to add a context bound in the middle of a chain of methods that all pass a type tag around, and then suddenly all the tags turn into pumpkins (because that unlucky method just reifies TypeRef(NoPrefix, <type parameter symbol>, Nil and passes it down the chain). Hence we decided to rename ConcreteTypeTag => TypeTag & TypeTag => AbsTypeTag, which makes a lot of sense from a reflection point of view. Unfortunately this broke macros (in a sense), because now everyone writes TypeTag context bounds on macro implementations, which breaks in trivial situations like: "def foo[T](x: T) = identity_macro(x)" (the type of x is not concrete, so macro expansion will emit an error when trying to materialize the corresponding TypeTag). Now we restore the broken balance by banning TypeTag from macro impls. This forces anyone to use AbsTypeTags, and if someone wants to check the input for presence of abstract types, it's possible to do that manually.
* | | | | | Merge pull request #1082 from VladUreche/topic/remove-anyref-from-libraryJosh Suereth2012-08-0710-21/+23
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Removes AnyRef specialization from library
| * | | | | Removes AnyRef specialization from libraryVlad Ureche2012-08-0710-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in #999, #1025 and https://groups.google.com/forum/?hl=en&fromgroups#!topic/scala-internals/5P5TS9ZWe_w instrumented.jar is generated from the current source, there's no need for a bootstrap commit. Review by @paulp.
* | | | | | Merge pull request #1077 from odersky/topic/inlineAdriaan Moors2012-08-071-4/+14
|\ \ \ \ \ \ | | | | | | | | | | | | | | Makes all private variables accessed from an @inline method non-private.
| * | | | | | Makes all private variables accessed from an @inline method non-private.Martin Odersky2012-08-071-4/+14
| | |_|/ / / | |/| | | | | | | | | | | | | | | | inlining across classes requires that accessed variables from @inline methods are not private.
* | | | | | Merge pull request #1067 from scalamacros/topic/ultimate-reflection-pull-requestAdriaan Moors2012-08-0722-49/+2107
|\ \ \ \ \ \ | | | | | | | | | | | | | | Ultimate reflection pull request #2
| * | | | | | accommodates Martin's commentsEugene Burmako2012-08-072-5/+3
| | | | | | |
| * | | | | | SI-6199 unit-returning methods now return unitEugene Burmako2012-08-067-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Scala reflection relies on Java reflection to perform member invocations, it inherits some of the quirks of the underlying platform. One of such quirks is returning null when invoking a void-returning method. This is now fixed by introducing a check after calling invoke.
| * | | | | | mirrors now support overriden fields and methodsEugene Burmako2012-08-064-23/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `checkMemberOf` was blocking base fields and methods that are overriden in receiver.getClass. Now this is fixed. The fix also uncovered an issue with field mirrors. Currently their `get` and `set` methods don't respect overriding and always return field values from a base class. After discussing this on a reflection meeting, we decided that this behavior is desirable and that for overriding people should use reflectMethod and then apply on getters/setters. See the discussion at: https://github.com/scala/scala/pull/1054.
| * | | | | | sanity check for reflectConstructorEugene Burmako2012-08-063-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 911bbc4 I've completely overlooked the fact that reflectConstructor exists and that is also needs sanity checks. Now reflectConstructor checks that the incoming symbol is actually a ctor, and that it is actually a ctor of the class reflected by the current mirror.
| * | | | | | SI-6181 method mirrors now support by-name argsEugene Burmako2012-08-063-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Arguments provided in by-name positions are now automatically wrapped in Function0 instances by method mirrors.
| * | | | | | SI-6179 mirrors now work with value classesEugene Burmako2012-08-069-34/+1681
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mirrors now carry a class tag of the receiver, so that they can detect value classes being reflected upon and adjust accordingly (e.g. allow Int_+ for ints, but disallow it for Integers). Surprisingly enough derived value classes (SIP-15 guys that inherit from AnyVal) have been working all along, so no modification were required to fix them.
| * | | | | | SI-6178 reflective invocation of magic symbolsEugene Burmako2012-08-065-16/+320
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Scala there are some methods that only exist in symbol tables, but don't have corresponding method entries in Java class files. To the best of my knowledge, these methods can be subdivided into five groups: 1) stuff weaved onto Any, AnyVal and AnyRef (aka Object), 2) magic methods that Scala exposes to fix Java arrays, 3) magic methods declared on Scala primitive value classes, 4) compile-time methods (such as classOf and all kinds of macros), 5) miscellaneous stuff (currently only String_+). To support these magic symbols, I've modified the `checkMemberOf` validator to special case Any/AnyVal/AnyRef methods and adjusted MethodMirror and ConstructorMirror classes to use special invokers for those instead of relying on Java reflection. Support for value classes will arrive in the subsequent commit, because it requires some unrelated changes to the mirror API (currently mirrors only support AnyRefs as their targets).
* | | | | | Merge pull request #1072 from adriaanm/copyrightJosh Suereth2012-08-07409-412/+412
|\ \ \ \ \ \ | | | | | | | | | | | | | | update and normalize copyright notice
| * | | | | | update and normalize copyright noticeAdriaan Moors2012-08-07409-412/+412
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* | | | | | Merge pull request #1063 from VladUreche/issue/5788-quickJosh Suereth2012-08-072-12/+23
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-5788 Tailcalls LabelDefs correctly duplicated
| * | | | | | SI-5788 Tailcalls LabelDefs correctly duplicatedVlad Ureche2012-08-062-12/+23
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... in specialization. This is a quick hack to get SI-5788 fixed in 2.10.x. The full patch, which fixes the tailcalls LabelDefs will be merged into trunk, as it's too late for big changes. For reference, the complete fix is: e86afe65c8
* | | | | | Merge pull request #1062 from jsuereth/sbt-compile-interface-testJosh Suereth2012-08-071-2/+76
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | SBT compiler interface now compiled in ant build. Ensures those still u...