summaryrefslogtreecommitdiff
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1063 from VladUreche/issue/5788-quickJosh Suereth2012-08-071-12/+19
|\ | | | | SI-5788 Tailcalls LabelDefs correctly duplicated
| * SI-5788 Tailcalls LabelDefs correctly duplicatedVlad Ureche2012-08-061-12/+19
| | | | | | | | | | | | | | | | | | | | ... 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 #1070 from paulp/topic/critical-2.10.xAdriaan Moors2012-08-076-54/+49
|\ \ | | | | | | SI-6063, SI-4945 and restore :warnings in the REPL
| * | Restored :warnings to working order.Paul Phillips2012-08-062-48/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As seen here. scala> class A { @deprecated("foo") def a = 1 } warning: there were 1 deprecation warnings; re-run with -deprecation for details defined class A scala> :warnings <console>:7: warning: @deprecated now takes two arguments; see the scaladoc. class A { @deprecated("foo") def a = 1 } ^ scala> val x = 5 toString warning: there were 1 feature warnings; re-run with -feature for details x: String = 5 scala> :warnings <console>:7: warning: postfix operator toString should be enabled by making the implicit value language.postfixOps visible. This can be achieved by adding the import clause 'import language.postfixOps' or by setting the compiler option -language:postfixOps. See the Scala docs for value scala.language.postfixOps for a discussion why the feature should be explicitly enabled. val x = 5 toString ^
| * | Fix for SI-4945, repl hang on -i input.Paul Phillips2012-08-063-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other breakage had accumulated among Settings. I determined that once upon a time, "MultiStringSetting" accepted arguments like this: scala -foo bip bop bar Somewhere this was changed to force a : argument, like scala -foo:bip,bop,bar This incurs breakage. The repl has always advertised its -i option without a colon and it has always been a MultiStringSetting. Forcing everything into the : seemed like the wrong thing, especially because it will stomp on any whitespace containing arguments, whereas in the original form scala -foo bip "bop bar" baz will yield its arguments as given. So lacking any good ideas and knowing something probably depends on each way already, I made it work both ways.
| * | Fix for SI-6063, broken static forwarders.Paul Phillips2012-08-061-0/+2
| | | | | | | | | | | | Have to rule out access boundaries as well as private/protected.
* | | Merge pull request #1066 from magarciaEPFL/ticket-SI-6102Adriaan Moors2012-08-071-0/+13
|\ \ \ | |/ / |/| | SI-6102 Wrong bytecode in lazyval + no-op finally clause
| * | SI-6102 avoid emitting illegal exception table rangeMiguel Garcia2012-08-061-0/+13
| |/
* | 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 #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-055-13/+18
|\ \ | | | | | | Promote unchecked warnings into being emitted by default.
| * | Promote unchecked warnings into being emitted by default.Paul Phillips2012-07-285-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-043-15/+34
|\ \ \ \ \ | |_|_|_|/ |/| | | | Made worksheet output wrap around after custimizable # of output columns
| * | | | Better worksheet support.Martin Odersky2012-08-033-14/+33
| | | | | | | | | | | | | | | | | | | | 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-311-1/+1
| | | | |
* | | | | 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-035-14/+20
|\ \ \ \ \ | | | | | | | | | | | | SI-5930 SI-5897 reduce redundant warnings in matches, fix flags usage
| * | | | | 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-244-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | encapsulate creating synthetic case labels while we're at it
* | | | | | moves Expr from api to baseEugene Burmako2012-08-023-27/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | reflect.makro => reflect.macros (Step I)Eugene Burmako2012-08-0228-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | renames asType to toType and asXXXSymbol to asXXXEugene Burmako2012-08-0210-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-022-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | SI-5732 members and derivatives now return ScopeEugene Burmako2012-08-029-19/+19
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firstly this unifies the reflection API - now both decls and members return Scope (not Scope and List[Symbol] as it were before). Secondly this fixes SI-5732 without having to sort the result of members. Type.members now returns Scope, a distinguished type, which has the `sorted` method, which does the required sorting if necessary. Also removes nonPrivateMembers and nonPrivateDeclarations to keep the API minimalistic (as can be seen from their implementation in internal.Types they are just members and decls with bridges and private members removed).
* | | | | Merge pull request #1030 from scalamacros/ticket/5751Josh Suereth2012-08-023-90/+115
|\ \ \ \ \ | | | | | | | | | | | | SI-5751 cleans up toolboxes for the release
| * | | | | SI-5751 cleans up toolboxes for the releaseEugene Burmako2012-07-313-90/+115
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the `freeTypes` parameters on `typeCheckExpr` and `runExpr`, since we now have public `substituteTypes` on both trees and types. Also implements long-awaited `inferImplicitValue` and `inferImplicitView` (thanks to Miles Sabin for nudging me!)
* | | | | Merge pull request #1032 from hubertp/issue/asm-long-signaturesJosh Suereth2012-08-011-2/+7
|\ \ \ \ \ | | | | | | | | | | | | I actually managed to hit the limit of Scala signature annotation not fi...
| * | | | | I actually managed to hit the limit of Scala signature annotation not ↵Hubert Plociniczak2012-07-311-2/+7
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fitting into a single string (high five everyone) and entered the undisovered region of arrEncode in GenASM. arrEncode returns Array[String] so asm.AnnotationWriter is not going to like it. Already discussed with @magarciaEPFL but please review again.
* / / / / Added more variants to achieve getLinkPosMartin Odersky2012-07-311-4/+15
|/ / / / | | | | | | | | | | | | getLinkPos is known to be flakey. This commit tries some variants and logs what failed.
* | | | Merge pull request #1020 from odersky/ticket/5866Josh Suereth2012-07-301-2/+10
|\ \ \ \ | | | | | | | | | | SI-5866 Support casting null to value classes
| * | | | SI-5866 Support casting null to value classesMartin Odersky2012-07-301-2/+10
| | | | | | | | | | | | | | | | | | | | The fix now supports null.asInstanceOf[C] where C is a value class that wraps a primitive type.
* | | | | Merge pull request #1016 from hubertp/2.10.x-issue/5031Josh Suereth2012-07-301-1/+0
|\ \ \ \ \ | | | | | | | | | | | | Fixed SI-5031. Only consider classes when looking for companion class.
| * | | | | Fixed SI-5031. Only consider classes when looking for companion class.Hubert Plociniczak2012-07-301-1/+0
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sym.effectiveOwner revealed this piece of inconsistency. companionModule is fine because similar check is there already. Review by @paulp.
* | | | | Merge pull request #1011 from odersky/ticket/5882Josh Suereth2012-07-301-0/+9
|\ \ \ \ \ | | | | | | | | | | | | Closes SI-5882
| * | | | | SI-5799 Secondary constructors in value classes not allowedMartin Odersky2012-07-291-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | I changed the SIP and added a test.
| * | | | | Closes SI-5882Martin Odersky2012-07-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | I have added a restriction that value classes may not contain inner classes or objects. This makes sense as the "outer" field of any such classes or objects would be ephemeral, with surprising results. SIP-15 has been changed accordingly.
* | | | | | Merge pull request #981 from adriaanm/ticket-2038Josh Suereth2012-07-301-1/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-2038 make pt fully-defined when typing Typed
| * | | | | | SI-2038 make pt fully-defined when typing TypedAdriaan Moors2012-07-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dropExistential turns existentials in the expected type (pt) that's passed to `typed` into `BoundedWildcardType`s, but those should not end up in trees when typing a `Typed` node, we didn't check for the type being fully defined (`isFullyDefined`) (and thus did not make it fully defined by turning these BWTs into existentials again using `makeFullyDefined`)
* | | | | | | Merge pull request #1015 from hubertp/2.10.x-issue/5603Josh Suereth2012-07-302-33/+28
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | Fixed SI-5603. Early definitions now get transparent positions.