summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Updated copyright to 2013Carlo Dapor2013-01-0212-12/+12
|
* Merge pull request #1816 from scalamacros/topic/enclosuresEugene Burmako2012-12-305-1/+59
|\ | | | | enclosures are now strongly typed and are no longer vals
| * enclosures are now strongly typed and are no longer valsEugene Burmako2012-12-255-1/+59
| |
* | Merge pull request #1807 from scalamacros/topic/ident-deprecation-warningsEugene Burmako2012-12-303-0/+20
|\ \ | | | | | | the scanner is now less eager about deprecations
| * | changes the flags to not depend on partestEugene Burmako2012-12-281-1/+1
| | | | | | | | | | | | | | | | | | Due to some reason, partest always enables -deprecation. Since Paul has just submitted a pull request, which removes this behavior, I'm updating the flags to make sure this test works even after Paul's change.
| * | the scanner is now less eager about deprecationsEugene Burmako2012-12-253-0/+20
| |/ | | | | | | | | | | When healing braces it isn't very useful to report deprecation warnings, especially since this process is just simple context-free skimming, which can't know about what positions can accept what identifiers.
* | Merge pull request #1809 from scalamacros/topic/ident-attachmentsPaul Phillips2012-12-294-0/+23
|\ \ | | | | | | fixes the typedIdent problem for good
| * | fixes the typedIdent problem for goodEugene Burmako2012-12-284-0/+23
| |/ | | | | | | | | | | Previous attachment retaining fix was only working for Idents which get turned into Selects. Now it works for all transformations applied to Idents (e.g. when an ident refers to something within a package obj).
* | Merge pull request #1818 from scalamacros/topic/auto-duplicate-expansionsEugene Burmako2012-12-294-0/+36
|\ \ | | | | | | macro expansions are now auto-duplicated
| * | macro expansions are now auto-duplicatedEugene Burmako2012-12-254-0/+36
| |/ | | | | | | | | | | | | | | | | | | | | The fix still requires macro developers to be careful about sharing trees by references, because attributed DefTrees will still bring trouble. However this is an improvement, because it doesn't make matters worse and automatically fixes situations similar to one in the test. A much more thorough discussion with a number of open questions left: http://groups.google.com/group/scala-internals/browse_thread/thread/492560d941b315cc
* | Merge pull request #1814 from scalamacros/topic/reflectionEugene Burmako2012-12-29155-342/+394
|\ \ | | | | | | adds extractors for TypeName, TermName and Modifiers
| * | cleans up usages of <init>Eugene Burmako2012-12-299-9/+9
| | |
| * | Changes reflection tests to use shorter name constructorsDen Shabalin2012-12-25154-341/+341
| | |
| * | Adds extractors for TypeName, TermName and ModifiersDen Shabalin2012-12-251-0/+52
| |/ | | | | | | | | | | | | | | | | | | | | This change allows to pattern match over type names, term names and modifiers. Otherwise it can be quite painful to match over complex trees as each name or modifiers requires a guard. This pull request also changes the name of default constructor for term and type names i.e. TypeName(s) instead of newTermName(s). This is shorter to type, more consistent with the rest of reflection api and consistent with the way it will be pattern matched later on.
* | SI-6846, regression in type constructor inference.Paul Phillips2012-12-281-0/+28
| | | | | | | | | | | | | | In 658ba1b4e6 some inference was gained and some was lost. In this commit we regain what was lost and gain even more. Dealiasing and widening should be fully handled now, as illustrated by the test case.
* | Cleaning up type alias usage.Paul Phillips2012-12-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I determined that many if not most of the calls to .normalize have no intent beyond dealiasing the type. In light of this I went call site to call site knocking on doors and asking why exactly they were calling any of .normalize .widen.normalize .normalize.widen and if I didn't like their answers they found themselves introduced to 'dropAliasesAndSingleTypes', the recursive widener and dealiaser which I concluded is necessary after all. Discovered that the object called 'deAlias' actually depends upon calling 'normalize', not 'dealias'. Decided this was sufficient cause to rename it to 'normalizeAliases'. Created dealiasWiden and dealiasWidenChain. Dropped dropAliasesAndSingleTypes in favor of methods on Type alongside dealias and widen (Type#dealiasWiden). These should reduce the number of "hey, the type alias doesn't work" bugs.
* | Shored up a hidden dealiasing dependency.Paul Phillips2012-12-284-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the comment says: // This way typedNew always returns a dealiased type. This // used to happen by accident for instantiations without type // arguments due to ad hoc code in typedTypeConstructor, and // annotations depended on it (to the extent that they worked, // which they did not when given a parameterized type alias // which dealiased to an annotation.) typedTypeConstructor // dealiases nothing now, but it makes sense for a "new" to // always be given a dealiased type. PS: Simply running the test suite is becoming more difficult all the time. Running "ant test" includes time consuming activities of niche interest such as all the osgi tests, but test.suite manages to miss the continuations tests.
* | Fix and simplify typedTypeConstructor.Paul Phillips2012-12-2841-108/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Investigating the useful output of devWarning (-Xdev people, it's good for you) led back to this comment: "normalize to get rid of type aliases" You may know that this is not all the normalizing does. Normalizing also turns TypeRefs with unapplied arguments (type constructors) into PolyTypes. That means that when typedParentType would call typedTypeConstructor it would find its parent had morphed into a PolyType. Not that it noticed; it would blithely continue and unwittingly discard the type arguments by way of appliedType (which smoothly logged the incident, thank you appliedType.) The simplification of typedTypeConstructor: There was a whole complicated special treatment of AnyRef here which appears to have become unnecessary. Removed special treatment and lit a candle for regularity. Updated lots of tests regarding newly not-so-special AnyRef.
* | Merge pull request #1786 from retronym/ticket/6745-3Paul Phillips2012-12-267-0/+42
|\ \ | | | | | | SI-6745 Fix <init> lookup
| * | SI-6745 Fix <init> lookupJason Zaugg2012-12-187-0/+42
| | | | | | | | | | | | | | | | | | We should only consult the decls of the enclosing class. Members of the self type, enclosing scopes, or imports should not be considered.
* | | Removed old pattern matcher.Paul Phillips2012-12-2616-145/+32
| |/ |/|
* | Merge pull request #1506 from som-snytt/issue/6446-plugin-descPaul Phillips2012-12-2221-32/+225
|\ \ | | | | | | PluginComponent contributes description to -Xshow-phases. (Fixes SI-6446)
| * | PluginComponent contributes description to -Xshow-phases.Som Snytt2012-12-1821-32/+225
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Global, SubComponent is called a phase descriptor, but it doesn't actually have a description. (Phase itself does.) This fix adds a description to PluginComponent so that plugins can describe what they do in -Xshow-phases. Elliptical descriptions Exploded archives Plugged-in partest Roundup at the Little h!
* | Merge pull request #1769 from soc/SI-6809Adriaan Moors2012-12-2011-33/+20
|\ \ | | | | | | SI-6809 Forbids deprecated case class definitions without parameter list
| * | SI-6809 Forbids deprecated case class definitions without parameter listSimon Ochsenreither2012-12-1311-33/+20
| | | | | | | | | | | | This has been deprecated since at least 2.7.7, so it should be good to go.
* | | Merge remote-tracking branch 'origin/2.10.x' into merge-2.10.xPaul Phillips2012-12-2054-52/+745
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: (31 commits) Implicit vars should have non-implicit setters. Deprecate `scala.tools.nsc.Phases` because it's dead-code. scaladoc Template: remove duplicate code and several usages of Option.get. adds scala-reflect.jar to MIMA in ant Test showing the absence of a forward reference update mailmap Remove dead code from `Global`. Cleanup MemberLookup. Better explain ambiguous link targets. typedIdent no longer destroys attachments fixes incorrect handling of Annotated in lazy copier simplifies checkBounds Recurse into instantiations when stripping type vars. Extract base scaladoc functionality for the IDE. Expand pattern match position tests. SI-6288 Remedy ill-positioned extractor binding. SI-6288 Fix positioning of label jumps SI-6288 Position argument of unapply Fixes SI-6758: force LazyAnnnotationInfo for DefDef and TypeDef SI-6795 Simplify errors related to "abstract override" on type members SI-6795 Adds negative check for "abstract override" on types in traits ... Conflicts: .mailmap src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/ast/DocComments.scala src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala src/compiler/scala/tools/nsc/doc/html/page/Source.scala src/compiler/scala/tools/nsc/doc/html/page/Template.scala src/compiler/scala/tools/nsc/doc/model/LinkTo.scala src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala test/scaladoc/run/links.scala
| * \ \ Merge pull request #1790 from paulp/2.10.0-wip-mergeAdriaan Moors2012-12-202-0/+6
| |\ \ \ | | | | | | | | | | Merge 2.10.0-wip into 2.10.x
| | * \ \ Merge remote-tracking branch 'origin/2.10.0-wip' into 2.10.0-wip-mergePaul Phillips2012-12-192-0/+6
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Eugene Burmako (1) and others # Via Adriaan Moors (2) and others * origin/2.10.0-wip: Fixing OSGi distribution. Fix for rangepos crasher. SI-6685 fixes error handling in typedApply
| * | \ \ \ Merge pull request #1788 from retronym/ticket/6848Paul Phillips2012-12-202-0/+4
| |\ \ \ \ \ | | |/ / / / | |/| | | | Implicit vars should have non-implicit setters.
| | * | | | Implicit vars should have non-implicit setters.Jason Zaugg2012-12-192-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise they trigger spurious feature warnings. scala> trait T { implicit var a: Any } <console>:7: warning: implicit conversion method a_= should be enabled by making the implicit value language.implicitConversions visible.
| * | | | | Merge pull request #1778 from JamesIry/p_SI-6795_2.10.xAdriaan Moors2012-12-192-0/+7
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6795 simplify "abstract override" errors on type members
| | * | | | | SI-6795 Simplify errors related to "abstract override" on type membersJames Iry2012-12-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of saying "only allowed on non-type members of traits" use separate errors for "not allowed on types" and "only allowed on members of traits"
| | * | | | | SI-6795 Adds negative check for "abstract override" on types in traitsJames Iry2012-12-102-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "abstract override" shouldn't was being allowed on types in traits but the result made no sense and the spec says that shouldn't be allowed.
| * | | | | | Merge pull request #1709 from retronym/ticket/3995Adriaan Moors2012-12-192-0/+38
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-3995 Exclude companions with an existential prefix.
| | * | | | | | Expand test with a stably qualified example.Jason Zaugg2012-12-052-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the example below, we need a view from `String => l.F0`, and the companion object `FO` is reachable by a stable, non existentially-bound path. class Lift { def apply(f: F0) {} class F0 object F0 { implicit def f2f0(fn: String): F0 = ??? } } object Test { val l = new Lift l.apply("") // okay } Followup for SI-3995
| | * | | | | | SI-3995 Exclude companions with an existential prefix.Jason Zaugg2012-12-052-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `(qual: Q).apply(expr)` where `expr` must be implictily converted to a path dependent type `T` defined in `qual`, we were looking for companion implicits via a path prefixed by an existential skolem `_1`. These aren't much good to us, as when we try to feed them into `mkAttributedQualifer`, a crash rightly ensues. This commit excludes companions prefixed by an existentially bound path.
| * | | | | | | Merge pull request #1727 from scalamacros/ticket/6548Paul Phillips2012-12-193-1/+15
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6548 reflection now correctly enters jinners
| | * | | | | | | SI-6548 reflection now correctly enters jinnersEugene Burmako2012-12-073-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Since the fix is about Java-compiled classes, the test needs *.class artifacts produced by javac. Therefore I updated javac-artifacts.jar to include the new artifacts along with their source code.
| * | | | | | | | Merge pull request #1759 from scalamacros/topic/annotatedPaul Phillips2012-12-194-0/+59
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | fixes incorrect handling of Annotated in lazy copier
| | * | | | | | | | fixes incorrect handling of Annotated in lazy copierEugene Burmako2012-12-134-0/+59
| | | | | | | | | |
| * | | | | | | | | Merge pull request #1707 from retronym/ticket/5390Adriaan Moors2012-12-179-0/+67
| |\ \ \ \ \ \ \ \ \ | | |_|_|_|_|/ / / / | |/| | | | | | | | SI-5390 Detect forward reference of case class apply
| | * | | | | | | | Test showing the absence of a forward referenceJason Zaugg2012-12-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are only forbidden in terms, they are permitted in types.
| | * | | | | | | | SI-5390 Detect forward reference of case class applyJason Zaugg2012-12-048-0/+56
| | | |_|/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refchecks performs (among others) two tasks at once: - detecting forward references - translating `qual.Case(...)` to `new qual.Case(...)` As is often the case with such multi-tasking tree traversals, completion of one task precluded the other.
| * | | | | | | | Merge pull request #1706 from retronym/ticket/5361Adriaan Moors2012-12-153-2/+9
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-5361 Avoid cyclic type with malformed refinement
| | * | | | | | | | SI-5361 Avoid cyclic type with malformed refinementJason Zaugg2012-12-043-2/+9
| | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The statement `val x = this` in the refinment type: (new {}): {val x = this} is lazily typechecked, in order to, according to the comment in `typedRefinment, "avoid cyclic reference errors". But the approximate type used ends up with: Refinment@1( parents = [...] decls = { val x: Refinement@1 }) This commit eagerly checks that there is no term definitions in type refinments, rather than delaying this. This changes the error message for SI-3614.
| * | | | | | | | Merge pull request #1766 from scalamacros/topic/typed-ident-attachmentsEugene Burmako2012-12-144-0/+22
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | typedIdent no longer destroys attachments
| | * | | | | | | | typedIdent no longer destroys attachmentsEugene Burmako2012-12-134-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When transforming Idents to qualified Selects, typedIdent used to forget about carrying original attachments to the resulting tree. Not anymore.
| * | | | | | | | | Merge pull request #1754 from retronym/ticket/6288Adriaan Moors2012-12-145-10/+239
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-6288 Perfecting positions
| | * | | | | | | | | Expand pattern match position tests.Jason Zaugg2012-12-122-11/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adds tests for unapplySeq and unapply: Boolean. Both seem to be well positioned after the previous changes.
| | * | | | | | | | | SI-6288 Remedy ill-positioned extractor binding.Jason Zaugg2012-12-122-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to `Option#get` on the result of the unapply method was unpositioned and ended up with the position of the `match`.