summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | SI-5604, selections on package objects.Paul Phillips2013-01-301-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] mkAttributedSelect, which creates a Select tree based on a symbol, has been a major source of package object bugs, because it has not been accurately identifying selections on package objects. When selecting foo.bar, if foo turns out to be a package object, the created Select tree must be foo.`package`.bar However mkAttributedSelect was only examining the owner of the symbol, which means it would work if the package object defined bar directly, but not if it inherited it.
| * | | | | | | | SI-5859, inapplicable varargs.Paul Phillips2013-01-304-39/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] And other polishing related to varargs handling.
| * | | | | | | | SI-5353, imperfect error message.Paul Phillips2013-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] The fix of course is a perfect error message.
| * | | | | | | | SI-5130, precision disappearing from refinement.Paul Phillips2013-01-301-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] Remove some code, win a prize.
| * | | | | | | | SI-4729, overriding java varargs in scala.Paul Phillips2013-01-302-14/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] This was a bad interaction between anonymous subclasses and bridge methods. new Foo { override def bar = 5 } Scala figures it can mark "bar" private since hey, what's the difference. The problem is that if it was overriding a java-defined varargs method in scala, the bridge method logic says "Oh, it's private? Then you don't need a varargs bridge." Hey scalac, you're the one that made me private! You made me like this! You! Conflicts: src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
| * | | | | | | | SI-2418, remove restriction on final vars.Paul Phillips2013-01-302-9/+3
| | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] The original fix for SI-2418 excluded final vars entirely, but the problem was not final vars per se, but the emission of ACC_FINAL in combination with ACC_VOLATILE. Since vars never get ACC_FINAL now, this is no longer an issue.
* | | | | | | | Merge pull request #2006 from retronym/backport/1226Paul Phillips2013-01-314-110/+114
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | [backport] SI-6301 / SI-6572 specialization regressions
| * | | | | | | | [backport] SI-6301 / SI-6572 specialization regressionsJason Zaugg2013-01-294-110/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit a3680be29ccd5314c5d027d473b37940eaecd530 Author: Paul Phillips <paulp@improving.org> Date: Fri Aug 31 10:20:16 2012 -0700 Actual fix for SI-6301, specialized crasher. This means the workaround in the previous commit is no longer reached, but it should remain where it is as a much needed layer of robustness/useful error reporting. Conflicts: src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Duplicators.scala commit f4c45ae204ce3ff3c16b19cab266d0b6515b6e0f Author: Paul Phillips <paulp@improving.org> Date: Fri Aug 31 10:49:24 2012 -0700 Rewrite of GenICode adapt. Started for debuggability, stayed for clarify/performance. Conflicts: src/compiler/scala/tools/nsc/backend/icode/GenICode.scala commit 74842f72a0af485e5def796f777f7003f969d75b Author: Paul Phillips <paulp@improving.org> Date: Fri Aug 31 08:45:34 2012 -0700 Workaround for SI-6301, @specialize crasher. SpecializeTypes is generating symbols with overloaded types which then proceed to crash in CleanUp or GenICode. Until I or someone works out why that is, take a look in case the overload is easily disambiguated by the argument list arity, in which case warn and proceed.
* | | | | | | | | Merge pull request #2000 from adriaanm/backport-pr-1873Paul Phillips2013-01-311-29/+50
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | [backport] SI-5378, unsoundness with type bounds in refinements.
| * | | | | | | | | [backport] SI-5378, unsoundness with type bounds in refinements.Paul Phillips2013-01-281-29/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the comment says: Not enough to look for abstract types; have to recursively check the bounds of each abstract type for more abstract types. Almost certainly there are other exploitable type soundness bugs which can be seen by bounding a type parameter by an abstract type which itself is bounded by an abstract type. SPECIAL: BUY ONE UNSOUNDNESS, GET ONE FREE In refinement types, only the first parameter list of methods was being analyzed for unsound uses of abstract types. Second parameter list and beyond had free unsoundness reign. That bug as well is fixed here.
* | | | | | | | | | Merge pull request #2046 from JamesIry/2.10.x_SI-4714Paul Phillips2013-01-311-2/+3
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-4714 Initialize history while initializing the REPL's reader
| * | | | | | | | | | SI-4714 Initialize history while initializing the REPL's readerJames Iry2013-01-311-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was possible to get a command into the REPL before the history recording object was set and so the command would be lost in the sands of time. This fix just moves the initialization of the history object into the JLineReader constructor, out of the post-init hook.
* | | | | | | | | | | Merge pull request #2037 from JamesIry/2.10.x_SI-2418Paul Phillips2013-01-312-9/+3
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | [backport] Removed restriction on final vars, SI-2418.
| * | | | | | | | | | | [backport] Removed restriction on final vars, SI-2418.Paul Phillips2013-01-312-9/+3
| | |_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport of b79c7600544db9964c228b94a2f70f3ed854f89b The original fix for SI-2418 excluded final vars entirely, but the problem was not final vars per se, but the emission of ACC_FINAL in combination with ACC_VOLATILE. Since vars never get ACC_FINAL now, this is no longer an issue.
* | | | | | | | | | | Merge pull request #2036 from scalamacros/ticket/5716Paul Phillips2013-01-311-1/+10
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | [backport] the scanner is now less eager about deprecations
| * | | | | | | | | | the scanner is now less eager about deprecationsEugene Burmako2013-01-311-1/+10
| | |_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Backport from https://github.com/scala/scala/pull/1807. Original commit is https://github.com/scala/scala/commit/e5d34d70499504e085ddf957c1c818ffb63f4e8d.
* | | | | | | | | | Merge pull request #2021 from gkossakowski/issue/SI-7009Grzegorz Kossakowski2013-01-314-4/+23
|\ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | | SI-7009: `@throws` annotation synthesized incorrectly
| * | | | | | | | | SI-7009: `@throws` annotation synthesized incorrectlyGrzegorz Kossakowski2013-01-304-4/+23
| | |_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 990b3c7 made `scala.throws` annotation polymorphic but forgot to adapt compiler code that synthesizes it, e.g. when parsing class files. The consequence was that we would get non-deterministically either `scala.throws` or `scala.throws[T]` as a type for synthesized annotation. The reason is that `Symbol.addAnnotation` would call `tpe` method which does not initialization of symbol so type parameters list would not be determined correctly. Only if info of that symbol was forced for other reason we would get `scala.throws[T]`. That non-deterministic behavior was observed in sbt's incremental compiler. Another problem we have is that Scala allows polymorphic exceptions so in ClassfileParser we could synthesize `@throws` annotation with wrong (polymorphic) type applied. In such case the best we can do is to convert such type to monomorphic one by introducing existentials. Here's list of changes this commit introduces: * The `Symbol.addAnnotation` that takes symbol as argument asserts that the type represented by that symbol is monomorphic (disabled due to cycles; see comments in the code) * Introduce `Symbol.addAnnotation` overload that allows us to pass an applied type * Change all places where polymorphic annotations are synthesized to pass an applied type * Handle polymorphic exception types in `ClassfileParser.parseExceptions` Fixes SI-7009.
* | | | | | | | | Merge pull request #1989 from adriaanm/rework-pr-1945Paul Phillips2013-01-311-10/+8
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-6968 Simple Tuple patterns aren't irrefutable
| * | | | | | | | | SI-6968 Simple Tuple patterns aren't irrefutableJason Zaugg2013-01-271-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts part of c82ecab. The parser can't assume that a pattern `(a, b)` will match, as results of `.isInstanceOf[Tuple2]` can't be statically known until after the typer. The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing this regression SI-6968. Keeping all of those fixed will require a better definition of irrefutability, and some acrobatics to ensure safe passage to the ambiguous trees through typechecking.
* | | | | | | | | | Merge pull request #2031 from JamesIry/2.10.x_SI-6669Paul Phillips2013-01-311-1/+1
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-6669 Add . to the default scalap classpath
| * | | | | | | | | | SI-6669 Add . to the default scalap classpathJames Iry2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default classpath for scalap did not include '.' which made it behave differently from javap in an annoying way. This commit adds it to the default. Also included is a test to make sure it's in the default but does not corrupt a user specified classpath.
* | | | | | | | | | | Merge pull request #2028 from JamesIry/2.10.x_SI-6728Paul Phillips2013-01-312-5/+5
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|/ / |/| | | | | | | | | | SI-6728 Fixes crash in parser on incomplete for expression
| * | | | | | | | | | SI-6728 Fixes crash in parser on incomplete for expressionJames Iry2013-01-302-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser was trying to take the position of an empty expression which would crash. Son on the empty expression case in TreeBuilder# makeWhile it tries to do that and, if that failed, gets a position that wraps both the condition and the body. I also made a slight improvement to the UnsupportedOperationEx messages in Position.
* | | | | | | | | | | Merge pull request #2014 from gkossakowski/bytecode-testingGrzegorz Kossakowski2013-01-301-0/+61
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | Add Bytecode test (ASM-based) to partest.
| * | | | | | | | | | Add Bytecode test (ASM-based) to partest.Grzegorz Kossakowski2013-01-291-0/+61
| | |_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new kind of test `Bytecode` that allows one to inspect bytecode generated for given piece of Scala code. The bytecode inspection is achieved by inspection of ASM trees. See the included example for details. NOTE: This commit does not introduce a new category of pratest tests. Bytecode tests should be run in `jvm` category of partest tests. Specific list of changes: * Add BytecodeTest that contains common utilities to partest * Add asm to classpath when compiling partest. That's not a new dependency as it's being already done for javac task we were running while compiling partest. * Add an example test that shows how to count null checks in given method.
* | | | | | | | | | Merge pull request #1997 from retronym/ticket/7035Paul Phillips2013-01-303-29/+23
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7035 Centralize case field accessor sorting.
| * | | | | | | | | | SI-7035 Centralize case field accessor sorting.Jason Zaugg2013-01-283-29/+23
| | |_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is both burdensome and dangerous to expect callers to reorder these. This was seen in the field permutation in the unapply method; a regression in 2.10.0.
* | | | | | | | | | Merge pull request #2008 from paulp/pr/asSeenFromOptGrzegorz Kossakowski2013-01-301-6/+6
|\ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | | Optimization in AsSeenFromMap.
| * | | | | | | | | Optimization in AsSeenFromMap.Paul Phillips2013-01-291-6/+6
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite all the eyes which have traveled over this code, we all managed to miss this: // Note that pre and clazz are fixed at construction class AsSeenFromMap(pre: Type, clazz: Symbol) { ... def apply(tp: Type): Type = if (skipPrefixOf(pre, clazz)) tp else ... } Additionally, the exclusion condition in asSeenFrom contained a useless check, here: // !isPossiblePrefix(clazz) alone is enough pre.normalize.isTrivial && !isPossiblePrefix(clazz)
* | | | | | | | | Merge pull request #2020 from adriaanm/rebase-pr-1994-2.10.xAdriaan Moors2013-01-301-8/+21
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | [retarget #1994 to 2.10.x] SI-6726 Improving pattern matcher analysis performance
| * | | | | | | | | Remove gratuitous varJason Zaugg2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In favour of a somber val.
| * | | | | | | | | SI-6726 Further optimization of pattern analysisJason Zaugg2013-01-302-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually fuse `.filterNot(..).map` in dropUnit. Before: real 1m23.574s user 1m51.795s sys 0m2.634s After: real 1m4.883s user 1m30.754s sys 0m1.776s
| * | | | | | | | | SI-6726 Hash consing for Pattern matching Sym-sJason Zaugg2013-01-302-7/+15
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the test case: https://issues.scala-lang.org/browse/SI-6726?focusedCommentId=61207&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-61207 time scalac -Ystatistics -Ystop-after:patmat sandbox/gen.scala Before: real 1m47.737s user 2m14.314s sys 0m2.783s After: real 1m23.574s user 1m51.795s sys 0m2.634s
* | | | | | | | | Merge pull request #2007 from retronym/backport/1021Adriaan Moors2013-01-301-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | [backport] Fix for SI-6154, VerifyError originating in uncurry.
| * | | | | | | | | [backport] Fix for SI-6154, VerifyError originating in uncurry.Paul Phillips2013-01-291-1/+1
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lhs still might be an Ident. Miguel did all the work, I just wrote it down in code form. (cherry picked from commit 48f8235822a2a100d6c4e8d3d7349df565ac6d40)
* | | | | | | | | SI-6516, macros comparing types with == instead of =:=.Paul Phillips2013-01-301-1/+1
| |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I gift-wrapped this ticket four months ago: 'I think it will be enough to say "tpe =:= MacroContextClass.tpe" rather than == .' Indeed. Had to open my own gift. Thanks, paulp!
* | | | | | | | SI-6651 Substitute `this` in extension method sigsJason Zaugg2013-01-291-7/+30
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for the likes of: class A[X](val x: X) extends AnyVal { def foo(xy: x.Y) {} } We have to do this in both directions, when synthesizing the extension method in `Extender#transform`, and later on when Erasure tries to find the corresponding extension methods by backing out the original signatures from the signatures of the synthesized methods in the companion. In the first case, we have to be careful to use a stable reference to the `self` parameter, which can satisfy the dependent types.
* | | | | | | Merge pull request #1981 from retronym/backport/1187Adriaan Moors2013-01-283-7/+13
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | [backport] SI-3577 BoundedWildcardType handling
| * | | | | | | [backport] SI-3577 BoundedWildcardType handlingJason Zaugg2013-01-263-7/+13
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 3c91b32d699a9e29d685ac20c9805f96c9f2db2c Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 01:16:47 2012 +0200 Mention BoundedWildcardType in "a standard type pattern match". (cherry picked from commit 00e46b3dbcea2b72fd3941b7ffc2efba382871e9) commit 0664be2b69b1ce013e937bc93f4e84b891676f1f Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 01:05:07 2012 +0200 Make RefChecks#validateVariance aware of BoundedWildcardType. The only test case that I know for this will be neutered by the imminent fix for SI-6258; so I haven't been able to test this. But trying this manually, you can see that this patch defers the the SI-6258 to the erasure phase. Original: scala.MatchError: ? (of class scala.reflect.internal.Types$BoundedWildcardType) at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.scala$tools$nsc$typechecker$RefChecks$RefCheckTransformer$$anon$$validateVariance$1(RefChecks.scala:894) at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.validateVariance(RefChecks.scala:965) Modified: java.lang.ClassCastException: scala.reflect.internal.Types$TypeRef$$anon$6 cannot be cast to scala.reflect.internal.Types$TypeBounds at scala.reflect.internal.Types$TypeMap.mapOver(Types.scala:4160) at scala.reflect.internal.transform.Erasure$ErasureMap.apply(Erasure.scala:156) (cherry picked from commit 2b4e7183fd24113cca5e868456668fd05c848168) commit 6ad651c94faf463133c742feb2aee59ef782ea1f Author: Jason Zaugg <jzaugg@gmail.com> Date: Fri Aug 24 00:54:59 2012 +0200 SI-3577 Make varianceInType aware of BoundedWildcardType. (cherry picked from commit 21105654c40ed0c462142bcbb6c8eced77f8b07a)
* | | | | | | Merge pull request #1936 from retronym/ticket/6891Adriaan Moors2013-01-284-3/+71
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | SI-6891 Fix value class + tailrec crasher.
| * | | | | | SI-6891 Fix value class + tailrec crasher.Jason Zaugg2013-01-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rhs.substituteSymbols(old, new) leaves us with: def loop#12225(x#12226: A#15491): scala#21.this.Unit#1615 = loop#12225(x#12226) In which the TermSymbol x#12226 has a stale info, pointing at the A#7274, the class type parameter, rather than A#15491, the corresponding type parameter of the synthetic backing method. I've improved `TreeSymSubstituter` to substitute not only `Tree#{tpe, symbol}`, but also `DefTree#sym.info`. The `pos` test that triggered the new code path are listed here: https://gist.github.com/4575687 AFAICS, no special treatment of Function, Return, or Import is needed in TreeSymSubstutor.
| * | | | | | Ill-scoped reference checking in TreeCheckersJason Zaugg2013-01-263-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Find trees which have an info referring to an out-of-scope type parameter or local symbol, as could happen in the test for SI-6981, in which tree transplanting did not substitute symbols in symbol infos. The enclosed, pending test for that bug that will now fail under -Ycheck:extmethods -Xfatal-warnings. [Now checking: extmethods] [check: extmethods] The symbol, tpe or info of tree `(@scala.annotation.tailrec def loop(x: A): Unit = loop(x)) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(val x: A = _) : A` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x, method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(loop(x)) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(loop) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(x) : A` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x, method loop, method bippy$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(<synthetic> val x2: O.Foo[A] = (x1.asInstanceOf[O.Foo[A]]: O.Foo[A])) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x2, method equals$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(<synthetic> val Foo$1: O.Foo[A] = x$1.asInstanceOf[O.Foo[A]]) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value Foo$1, method equals$extension, object Foo, object O, package <empty>, package <root> [check: extmethods] The symbol, tpe or info of tree `(Foo$1) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value Foo$1, method equals$extension, object Foo, object O, package <empty>, package <root> error: TreeCheckers detected non-compliant trees in t6891.scala one error found
| * | | | | | Make value classes TreeCheckers friendlyJason Zaugg2013-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - allow for re-typechecking by disabling "redefinition of equals" errors for synthetic methods.
* | | | | | | Merge pull request #1973 from JamesIry/SI-4602_2.10.xJames Iry2013-01-282-7/+18
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | SI-4602 Make fsc absolutize source file names
| * | | | | | SI-4602 Make fsc absolutize source file namesJames Iry2013-01-252-7/+18
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fsc server was using a path supplied by the client to turn things like class path values into absolute paths. But it wasn't absolutizing the source file names supplied to the compiler which lead to SI-4602. This commit adds that absolutizing bit and cleans the logic up a bit so that the settings object isn't told a path that it already knows. A test is included that simulates changing directory by forcing two different -current-dir settings on two different compile sessions on the same server process.
* | | | | | Merge pull request #1988 from melloc/fsc-temporary-directory-2.10.xJames Iry2013-01-281-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-4733 - fsc no longer creates a single temp directory for all users.
| * | | | | | SI-4733 - fsc no longer creates a single temp directory for all users.Cody Mello2013-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsc previously created a single temporary directory called "scala-devel". This is an issue, since the directory belongs to whoever created the directory. Depending on the user's umask, this directory may only be writable for the creator. This causes problems for any other users who then try to use fsc or invoke fsc indirectly. Other programs usually solve this issue by creating a separate directory for each user, either by appending the username to a base directory name or creating a new direcotory with a random name with a program like "mktemp". This commit changes CompileSocket to use the first method. Fixes SI-4733 backport to 2.10.x
* | | | | | | Merge pull request #1927 from JamesIry/SI-6863_2.10.xJames Iry2013-01-282-10/+33
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | SI-6863 Fix verify error in captured var inited from block w try/catch
| * | | | | | SI-6863 Fix verify error in captured var inited from expr with try/catchJames Iry2013-01-252-10/+33
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a captured var was inited from a try/catch we did something reasonable. But if the var was inited from a more complicated expression (if/else, a block, match/case, etc) that ended with a try/catch then we didn't and we were generating faulty byte code. This fix patches LambdaLift to add the missing cases. For known simple expressions, the translation is just new *Ref(expr). For try/catch, if/else, match/case, and blocks this recursively walks down the internal result expressions to translate them. E.g. if(cond) trueExpr else falseExpr becomes if(cone) translate(trueExpr) else translate(falseExpr) For unknown expression types, the translation is {val temp = expr; new *Ref(expr) }