summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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 #1050 from scalamacros/topic/better-error-messagesJosh Suereth2012-08-062-14/+27
|\ | | | | better error messages for Symbol.asXXX methods
| * better error messages for Symbol.asXXX methodsEugene Burmako2012-08-062-14/+27
| |
* | Merge pull request #1059 from magarciaEPFL/ticket-SI-6188Josh Suereth2012-08-064-2/+23
|\ \ | | | | | | SI-6188
| * | SI-6157 don't inline callee with exception-handler(s) if potentially unsafeMiguel Garcia2012-08-062-3/+9
| | |
| * | SI-6188 ICodeReader notes exception handlers, Inliner takes them into accountMiguel Garcia2012-08-063-1/+16
| | |
* | | Merge pull request #1061 from scalamacros/topic/sbt-compatJosh Suereth2012-08-061-0/+3
|\ \ \ | | | | | | | | compatibility stub for SBT 0.12.0
| * | | compatibility stub for SBT 0.12.0Eugene Burmako2012-08-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in http://groups.google.com/group/scala-internals/browse_thread/thread/9ee8df2ae9d43169, recent change of return type for Type.members (from List[Symbol] to Scope) broke compiler-interface for SBT 0.12.0-final. This stub (courtesy of Jason Zaugg) keeps reflection API untouched and also fixes SBT. Win-win.
* | | | Merge pull request #1055 from scalamacros/topic/deprecate-manifest-incantationsJosh Suereth2012-08-061-0/+3
|\ \ \ \ | | | | | | | | | | adds deprecation annotations on manifest incantations
| * | | | adds deprecation annotations on manifest incantationsEugene Burmako2012-08-051-0/+3
| | |_|/ | |/| |
* | | | Merge pull request #1047 from scalamacros/topic/moar-symbol-testsJosh Suereth2012-08-062-0/+46
|\ \ \ \ | |_|/ / |/| | | adds more tests for api.Symbols
| * | | adds more tests for api.SymbolsEugene Burmako2012-08-062-0/+46
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | I overlooked some of the tests that should be added to the public API. This commit fixes my mistake. Also see 027b00171c. To reiterate the reasoning behind introduction of test methods into the API. I'd argue that the API duplication w.r.t flags is trumped by unified interface to tests and better encapsulation (especially since some of the flags have different meaning depending on whether the flaggee is a term or a type).
* | | Merge pull request #1045 from scalamacros/ticket/6175Josh Suereth2012-08-061-1/+10
|\ \ \ | |_|/ |/| | SI-6175 reflect over classes with symbolic names
| * | SI-6175 reflect over classes with symbolic namesEugene Burmako2012-08-031-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Top-level classes with symbolic names (having binary names like $colon$colon) have previously been incorrectly treated as local classes by Scala reflection. As a result they were loaded as if they weren't pickled (i.e. as Java classes). Moreover this bug also had a more subtle, but more dangerous manifestation. If such a class has already been loaded indirectly by unpickling another class (which refers to it in its pickle) and then someone tried to load it explicitly via classToScala, then it would be loaded twice (once as a Scala artifact and once as a Java artifact). This is a short route to ambiguities and crashes. The fix first checks whether a class with a suspicious name (having dollars) can be loaded as a Scala artifact (by looking it up in a symbol table). If this fails, the class is then loaded in Java style (as it was done before). Ambiguous names that can be interpreted both ways (e.g. foo_$colon$colon) are first resolved as Scala and then as Java. This prioritization cannot lead to errors, because Scala and Java artifacts with the same name cannot coexist, therefore loading a Scala artifact won't shadow a homonymous Java artifact.
* | | Merge pull request #1049 from paulp/uniques-per-runAdriaan Moors2012-08-052-1/+2
|\ \ \ | | | | | | | | Clear uniques via perRunCaches.
| * | | Clear uniques via perRunCaches.Paul Phillips2012-08-042-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | That lets this huge cache be cleared eagerly after a run is over rather than lazily when another run begins. This arrives pre-LGTMed by Important People.
* | | | Merge pull request #1051 from lrytz/t6074Adriaan Moors2012-08-051-1/+3
|\ \ \ \ | | | | | | | | | | SI-6074 disallow implicit enrichment with constructor
| * | | | SI-6074Lukas Rytz2012-08-041-1/+3
| | |_|/ | |/| | | | | | | | | | | | | | When selecting a non-accessible constructor, don't infer a view to something with an accessible constructor.
* | | | Merge pull request #1012 from paulp/topic/unchecked-goes-hollywoodAdriaan Moors2012-08-057-38/+38
|\ \ \ \ | |_|/ / |/| | | Promote unchecked warnings into being emitted by default.
| * | | Promote unchecked warnings into being emitted by default.Paul Phillips2012-07-287-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make that viable, suppression of unchecked warnings is now available on a per-type-argument basis. The @unchecked annotation has hereby been generalized beyond exhaustiveness to mean context-dependent "disable further compiler checking on this entity." Example of new usage: def f(x: Any) = x match { case xs: List[String @unchecked] => xs.head // no warning case xs: List[Int] => xs.head // unchecked warning } It turns out -unchecked has been put to other noisy uses such as the pattern matcher complaining about its budget like a careworn spouse. This actually simplified the path forward: I left -unchecked in place for that and general compatibility, so those warnings can be enabled as before with -unchecked. The erasure warnings I turned into regular warnings, subject to suppression by @unchecked. Review by @odersky.
* | | | Merge pull request #1023 from paulp/issue/6084Adriaan Moors2012-08-041-1/+1
|\ \ \ \ | | | | | | | | | | Fix for SI-6084, type alias crasher.
| * | | | Fix for SI-6084, type alias crasher.Paul Phillips2012-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "no need for pt.normalize here, is done in erasure" ORLY? Review by @adriaanm.
* | | | | Merge pull request #1040 from hubertp/issue/asm-long-signatures-againJosh Suereth2012-08-041-4/+4
|\ \ \ \ \ | | | | | | | | | | | | Fixes SI-6172.
| * | | | | Fixes SI-6172.Hubert Plociniczak2012-08-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the credit for fixing magical constants in the encoding algorithm goes to @magarciaEPFL. This time provided a test case that exercises GenASM.
* | | | | | Merge pull request #1028 from odersky/topic/worksheetAdriaan Moors2012-08-044-22/+47
|\ \ \ \ \ \ | | | | | | | | | | | | | | Made worksheet output wrap around after custimizable # of output columns
| * | | | | | Better worksheet support.Martin Odersky2012-08-034-19/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We now move instrumentation info to the end of lines where possible so that line and column positions are kept unchanged wrt original source. This is important for error reporting.
| * | | | | | Made worksheet output wrap around after custimizable # of output columns.Martin Odersky2012-07-312-8/+12
| | | | | | |
* | | | | | | staticTpe => staticType, actualTpe => actualTypeEugene Burmako2012-08-041-5/+5
| |_|_|_|/ / |/| | | | |
* | | | | | Merge pull request #1022 from odersky/ticket/5764Josh Suereth2012-08-031-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-5764 Honor -language:_
| * | | | | | SI-5764 Honor -language:_Martin Odersky2012-07-301-1/+1
| | |_|/ / / | |/| | | | | | | | | | | | | | | | We now enable all language feature if -language:_ is given on the command line. Review by @paulp
* | | | | | Merge pull request #982 from adriaanm/ticket-wolfcryJosh Suereth2012-08-038-22/+44
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-5930 SI-5897 reduce redundant warnings in matches, fix flags usage
| * | | | | | use hasAllFlags to detect gadt skolemsAdriaan Moors2012-07-241-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | trying to compromise between - easy discovery of what special mix of flags identifies a gadt skolem - ensuring that hasAllFlags is used and not hasFlag keeping the secret combo close to the creator/detector methods instead of moving them to Flags ideally, we'd allocate a new bit in Flags, but that's to invasive right now these symbols are also relatively short-lived: thet are created in adaptConstrPattern and removed at the end of typedCase
| * | | | | | SI-5930 don't warn about dead code in jump to caseAdriaan Moors2012-07-241-1/+5
| | | | | | |
| * | | | | | SI-5897 don't check sensicality in matchAdriaan Moors2012-07-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the pattern matching analysis should be more precise anyway (don't warn twice)
| * | | | | | move synthetic case symbol detection to treeInfoAdriaan Moors2012-07-246-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | encapsulate creating synthetic case labels while we're at it
* | | | | | | Merge pull request #1034 from xuwei-k/fix-scaladocJosh Suereth2012-08-034-5/+5
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | minor fixes scaladoc
| * | | | | | minor fixes scaladocxuwei-k2012-08-014-5/+5
| | | | | | |
* | | | | | | first stab at serialization of exprs and tagsEugene Burmako2012-08-023-5/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of trying to serialize the entire universe and failing miserably (which happens now), exprs and type tags will now serialize their creators and deserialize into scala.reflect.basis. Since creators produced by reification are not serializable right now, serialization will crash. That's a small improvement over state of the art functionality-wise, but it's a step forward robustness-wise. Next step in this direction is generation of serialization code for creators. Related issues: SI-5919 and SI-5908. Also see the discussion at scala-internals http://groups.google.com/group/scala-internals/browse_thread/thread/ef63f8b5bd194c7c
* | | | | | | moves Expr from api to baseEugene Burmako2012-08-0210-88/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step in supporting serialization for exprs and type tags. Generally speaking universes and mirrors cannot be serialized (even not taking into account all the amount of scalac-specific transient stuff, java mirrors use classloaders, which are not serializable). Hence we can only serialize tree and type creators, and deserialize them into the mirror we surely know will be there - the scala.reflect.basis.rootMirror. To do that we need to have exprs in scala.reflect.base. Luckily all the trees are already in base, we only need to move a single file to scala-library.jar. Another good news is that reification logic is simplified, because we don't have to special case exprs as being defined in ApiUniverseClass.
* | | | | | | evicts last traces of makro from our codebaseEugene Burmako2012-08-022-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the stubs left out to appease the old starr, fixes macro tests.
* | | | | | | reflect.makro => reflect.macros (Step I)Eugene Burmako2012-08-0254-72/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Builds a starr that uses stuff from scala.reflect.macros for macro activities. Crucial makro thingies (such as makro.Context or makro.internal.macroImpl) are temporarily left in place, because they are necessary for previous starr. Macro tests will be fixed in a dedicated commit, so that they don't pollute meaningful commits, making the life easy for reviewers and spelunkers.
* | | | | | | removes -Xmacro-(.*)-classpath compiler optionsEugene Burmako2012-08-023-67/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These options were meant to be used to bootstrap macros defined in our codebase However we can bootstrap perfectly without any additional effort, because library classpath classloader can delegate to tool classpath classloader to load macro implementations from starr. Since then (for several months) this functionality hasn't proven to be useful, neither anyone on the mailing list or stackoverflow asked questions about it (even despite it was explicitly mentioned in the "cannot load macro impl" error message). Hence I suggest that it is totally unnecessary and should be removed.
* | | | | | | prepares our macro defs for refactoring (Step II)Eugene Burmako2012-08-027-17/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the previous commit the compiler doesn't need any help to find out that fast-tracked macros are macros. Hence I'm replacing their RHSes with the universal ??? body. This way macro definitions defined in scala (for example, tag materialization macros or certain string formatters) won't stand in the way of the changes to the macro system.
* | | | | | | prepares our macro defs for refactoring (Step I)Eugene Burmako2012-08-022-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In our codebase we have a bunch of macros, and some of those macros (namely, tag materialization macros and string context "f" formatter) are used inside the compiler itself. The logic of those macros is hardwired into starr's fast track, so it doesn't rely on any of the subsystems of the macro engine to be located, bound and executed. But to trigger this logic we need to color these macros as macros, i.e. as term symbols having the MACRO flag. Currently this works automatically, because fast track macros (the same as regular macros) have their rhs in the "macro ???" form. Having seen the "macro" keyword, the compiler knows that the corresponding def declares a macro and sets the MACRO flag. As the latest refactoring attempt has shown, the "macro" in "macro ???" is unnecessary and might stand in the way of macro refactorings. After all if some symbol is in the fast track registry, then it's definitely a macro. Hence I'm changing the compiler to not need the "macro" keyword in declarations of fast track macros anymore.
* | | | | | | more refinements of reflection APIEugene Burmako2012-08-027-86/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a bunch of test methods to symbols to cover public flags: (e.g. isPrivate, isFinal, isOverride, isImplicit, etc). I'd argue that the API duplication w.r.t flag sets is trumped by unified interface to tests and better encapsulation. Also updated the API to be easier to understand after prior exposure to Java or .NET reflection APIs: 1) Added typeParams to TypeSymbol and ClassSymbol. 2) Renamed MethodSymbol.resultType to returnType. 3) Removed the distinction between MethodSymbol.params vs MethodSymbol.allParams now we just have MethodSymbol.params: List[List[Symbol]].
* | | | | | | SI-5888 Mirrors now have sane toStringsEugene Burmako2012-08-021-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds informative toString for InstanceMirror, FieldMirror, MethodMirror (for methods and constructors), ClassMirror and ModuleMirror. Universe mirrors (e.g. JavaMirrors or compiler mirrors) already have good toString methods that show their affiliation and/or classpaths.
* | | | | | | renames asType to toType and asXXXSymbol to asXXXEugene Burmako2012-08-0221-116/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renaming arguably makes the intent of `asType` more clear, but more importantly it shaves 6 symbols off pervasive casts that are required to anything meaningful with reflection API (as in mirror.reflectMethod(tpe.member(newTermName("x")).asMethodSymbol)).
* | | | | | | miscellaneous refinements of reflection APIEugene Burmako2012-08-027-101/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Removed unnecessary (i.e. implementable with pattern matching) type APIs. 2) Renamed isHigherKinded to takesTypeArgs making it easier to understand. 2) typeParams and resultType have been moved from MethodType to MethodSymbol Strictly speaking they are superfluous, but they are used very often.
* | | | | | | navigation between fields and accessorsEugene Burmako2012-08-023-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works around SI-5736 that's been deemed too risky to be fixed in 2.10.0. A reflection newbie will be unlikely to acquire a field symbol from its name, but the `accessed` method provides an easy way to navigate to it from a getter.
* | | | | | | moves most of symbol tests in API to descendantsEugene Burmako2012-08-021-73/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Things like tpe.member("foo").isSkolem don't make much sense.