summaryrefslogtreecommitdiff
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* 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.
| * | | | Fixed SI-5603. Early definitions now get transparent positions.Hubert Plociniczak2012-07-302-33/+28
| | |_|/ | |/| | | | | | | | | | | | | | | | | | This includes a fix for a minor problem described in #594 - ensureNonOverlapping still focuses on default position when outside of early defs. Review by @dragos, @odersky.
* | | | Merge pull request #998 from odersky/topic/bootpackagesJosh Suereth2012-07-301-1/+13
|\ \ \ \ | | | | | | | | | | Avoids loading scala.package and scala.reflect.package from source if a ...
| * | | | Avoids loading scala.package and scala.reflect.package from source if a ↵Martin Odersky2012-07-261-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | classfile exists. We know that loading these packages from source leads to compilation errors. To reproduce: Update scala.reflect.package, make sure it is on the source path and recompile anything using it. You will get a number of errors having to do with ClassTags and macro expansions. With the patch, these errors go away because the package is not loaded as long as a classfile exists.
* | | | | Merge pull request #1013 from odersky/ticket/5878odersky2012-07-301-2/+11
|\ \ \ \ \ | | | | | | | | | | | | Closes SI-5878
| * | | | | Closes SI-5878Martin Odersky2012-07-291-2/+11
| | |_|_|/ | |/| | | | | | | | | | | | | We need to impose an additional rule on value classes: They may not unbox directly or indirectly to themselves.
* | | | | Merge pull request #1005 from odersky/topic/worksheetodersky2012-07-308-68/+155
|\ \ \ \ \ | |_|_|/ / |/| | | | IDE improvements, with particular focus on making worksheets work.
| * | | | New Worksheet mixing schemeMartin Odersky2012-07-274-100/+109
| | | | | | | | | | | | | | | | | | | | Debug changes
| * | | | Adds method askForResponseMartin Odersky2012-07-273-2/+31
| | | | | | | | | | | | | | | | | | | | Adds method askForResponse which returns a response immediately instead of waiting for a result. That way, one can wait for an ask's result using a timeout.
| * | | | Disable interrupts during code instrumentationMartin Odersky2012-07-271-4/+8
| | | | | | | | | | | | | | | | | | | | Code instrumentation needs to see a consistent snapshot of a source file. To achieve that we disable interrupts during getInstrumented.
| * | | | New Executor.Martin Odersky2012-07-273-4/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To try it out: run "instrument worksheet" as usual in the REPL. Worksheet needs to have enclosing object definition. Say it is named "Obj". This will generate a file Obj$instrumented. You can compile that file separately and run it using Java. It should reproduce itself.
* | | | | Merge pull request #990 from VladUreche/issue/6140Josh Suereth2012-07-291-1/+1
|\ \ \ \ \ | | | | | | | | | | | | SI-6140 Scaladoc infinite recursion in wiki parser
| * | | | | SI-6140 Scaladoc infinite recursion in wiki parserVlad Ureche2012-07-251-1/+1
| | |_|/ / | |/| | | | | | | | | | | | | introduced by dc70d1b7.
* | | | | Merge pull request #988 from paulp/issue/4560Josh Suereth2012-07-293-38/+30
|\ \ \ \ \ | | | | | | | | | | | | Issue/4560
| * | | | | Revert "tentative fix for RC5 lift build problem."Johannes Rudolph2012-07-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cb4fd65825f3c88908103e48d0d7e89d70d26c22. Conflicts: src/compiler/scala/tools/nsc/symtab/Types.scala src/compiler/scala/tools/nsc/typechecker/Contexts.scala
| * | | | | Revert "Closes #4560. Review by dragos." (introduction of safeREF)Johannes Rudolph2012-07-241-32/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 124cf3f9cbdc582a432c13edd229ba9b8726b99f. Conflicts: src/compiler/scala/tools/nsc/transform/CleanUp.scala
| * | | | | Revert fix part of "Closes 4560. Review by dragos."Johannes Rudolph2012-07-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7127d8293775905acd0d04e21d9e045b5c029261. Conflicts: test/files/run/t4560.scala
| * | | | | Fix SI-4560, NoSuchMethodErrors involving self types.Paul Phillips2012-07-241-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following this commit are reversions of three prior commits which introduced difficulties of their own, plus extra tests for this issue and SI-4601, all of which I pinched from jrudolph. Maybe there was a good reason for some of the complicated code related to this ticket. I took the naive position that if we avoided generating a method call to a particular receiver if the receiver has no such method, we would encounter fewer NoSuchMethodErrors. I would believe one can construct a scenario which this doesn't handle correctly, but it's hard to believe this isn't a big improvement. Review by @jrudolph, @odersky.
* | | | | | Merge pull request #1002 from magarciaEPFL/fixes210Paul Phillips2012-07-282-5/+31
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6142: warn @inline-methods ending up not inlined (rightfully or not)
| * | | | | | SI-6142: warn @inline-methods ending up not inlined (rightfully or not)Miguel Garcia2012-07-262-5/+31
| | |/ / / / | |/| | | |
* | | | | | Closed 6029 ...Martin Odersky2012-07-281-24/+40
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | ... in a less nice way than I would like. Essentially, we mask type errors at later stages that arise from comparing existentials and skolems because we know that they are not tracked correctly through all tree transformations. Never mind that all these types are going erased anyway shortly afterwards. It does not smell nice. But as I write in the comment, maybe the best way out is to avoid skolems altogether. Such a change by far exceeds the scope of this pull request however.
* | | | | Eliminated all the current feature warnings.Paul Phillips2012-07-276-7/+10
| | | | | | | | | | | | | | | | | | | | This pretty much takes us down to deprecation and inliner warnings.
* | | | | Changed isHidden condition back to isSynthetic.Paul Phillips2012-07-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we were blessed with spurious warnings. With this commit I have eliminated every warning in trunk except for deprecation, feature, and inliner warnings, plus one due to SI-6146. I'm not going to count "pattern matcher performance warnings" which are presently preventing me from turning on -unchecked even though there are no genuine -unchecked warnings remaining. Hey, get your own option! Conflicts: src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
* | | | | Eliminated remainder of "catches Throwable" warnings.Paul Phillips2012-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And also non-exhaustive matches. And added -nowarn to the build options for scalacheck, we don't need to hear the warnings for code we aren't able to fix.
* | | | | Improve unchecked warnings a lot.Paul Phillips2012-07-273-57/+82
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't warn on "uncheckable" type patterns if they can be statically guaranteed, regardless of their runtime checkability. This covers patterns like Seq[Any] and lots more. Review by @adriaanm.
* | | | Merge pull request #976 from adriaanm/ticket-4440bAdriaan Moors2012-07-251-25/+25
|\ \ \ \ | |/ / / |/| | | SI-4440 workaround: avoid outer accessor that'll vanish
| * | | SI-4440 workaround: avoid outer accessor that'll vanishAdriaan Moors2012-07-231-25/+25
| |/ / | | | | | | | | | | | | | | | outer accessors of final classes are dropped in constructors apply some foresight in explicit outer and replace those doomed outer checks by `true` (since this is unfortunate, we generate an unchecked warning)
* | | Merge pull request #966 from paulp/issue/6117Adriaan Moors2012-07-242-3/+16
|\ \ \ | | | | | | | | SI-6117 regression involving import ambiguity.
| * | | Fix SI-6117, regression involving import ambiguity.Paul Phillips2012-07-211-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today I learned that foo.member("bar") != foo.member("bar") if bar is overloaded, because each lookup of an overloaded member creates a new symbol (with equivalent OverloadedTypes.) How should symbols be compared so these do not appear unequal? Is there a method which unpacks the alternatives and compares them individually? It seems likely there are additional bugs which arise from not covering this case. Since this bug is in the context of importing, if the prefixes are identical then I can compare the names instead of the symbols and this issue goes away. But for the rest of the time during which one might encounter overloaded symbols, that would be a very lossy operation, since the overloaded symbol might be encoding any subset of the members with that name. There are lots of references to "OverloadedSymbol" in the comments of various methods in Types, but no such class is visible in the history. If we had such a thing, we could refine its equals method to recognize equivalent overloads. Review by @odersky.
| * | | Renaming files to please ant.Paul Phillips2012-07-211-0/+0
| | | | | | | | | | | | | | | | "If the names don't fit, do not commit!"
* | | | Merge pull request #974 from adriaanm/repull-unchecked-hkAdriaan Moors2012-07-241-5/+7
|\ \ \ \ | | | | | | | | | | Improve unchecked warnings.
| * | | | Improve unchecked warnings.Paul Phillips2012-07-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Spurious test was not good. Better test avoids suppressing some legitimate warnings. Review by @moors.
* | | | | Merge pull request #979 from adriaanm/ticket-6111Adriaan Moors2012-07-246-62/+88
|\ \ \ \ \ | |_|_|_|/ |/| | | | SI-6111 accept single-subpattern unapply pattern
| * | | | docs related to fix for SI-6111Adriaan Moors2012-07-242-3/+9
| | | | |
| * | | | SI-6111 accept single-subpattern unapply patternAdriaan Moors2012-07-236-62/+82
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An extractor pattern `X(p)` should type check for any `X.unapply`/`X.unapplySeq` that returns an `Option[_]` -- previously we were confused about the case where it was an `Option[(T1, ... , Tn)]`. In this case, the expected type for the pattern `p` is simply `(T1, ... , Tn)`. While I was at it, tried to clean up unapplyTypeList and friends (by replacing them by extractorFormalTypes). From the spec: 8.1.8 ExtractorPatterns An extractor pattern x(p1, ..., pn) where n ≥ 0 is of the same syntactic form as a constructor pattern. However, instead of a case class, the stable identifier x denotes an object which has a member method named unapply or unapplySeq that matches the pattern. An unapply method in an object x matches the pattern x(p1, ..., pn) if it takes exactly one argument and one of the following applies: n = 0 and unapply’s result type is Boolean. n = 1 and unapply’s result type is Option[T], for some type T. the (only) argument pattern p1 is typed in turn with expected type T n > 1 and unapply’s result type is Option[(T1, ..., Tn)], for some types T1, ..., Tn. the argument patterns p1, ..., pn are typed in turn with expected types T1, ..., Tn
* / | | SI-4881 infer variance from formals, then resultMartin Odersky2012-07-231-2/+13
|/ / / | | | | | | | | | | | | | | | | | | | | | Changed behavior so that when determining the target variance of a method parameter, the variance in formals comes first. If variance is still undecided by that, the variance in the result type is used as a secondary criterion. (This is also done when determining prototype type params.)
* | | Merge pull request #964 from odersky/ticket/6090Adriaan Moors2012-07-231-1/+1
|\ \ \ | |/ / |/| | SI-6090 correct rewriting of overloaded value class ==
| * | SI-6090Martin Odersky2012-07-211-1/+1
| | | | | | | | | | | | Sharpens the test so that only Object_== and Object_!= methods on valueclasses may be rewritten in posterasure, whereas user-defined methods are not rewritten.
* | | Merge pull request #965 from dragos/fix-package-prefixAdriaan Moors2012-07-221-2/+10
|\ \ \ | |_|/ |/| | Handle multiple packages in one source file in the presentation compiler.
| * | Handle multiple packages in one source file in the presentation compiler.Iulian Dragos2012-07-211-2/+10
| |/ | | | | | | | | | | | | The PC symbol loader would mistakenly refuse to enter symbols if more than one package declaration occurred in the same file. This has become common practice: package object foo { … } package foo { … }
* | Merge pull request #958 from adriaanm/ticket-1832Josh Suereth2012-07-212-57/+67
|\ \ | | | | | | SI-1832 consistent symbols in casedef's pattern&body
| * | SI-1832 consistent symbols in casedef's pattern&bodyAdriaan Moors2012-07-201-32/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the only change to typedBind in this commit (beyond refactoring to keep my eyes from bleeding), is explained by the added comment: have to imperatively set the symbol for this bind to keep it in sync with the symbols used in the body of a case when type checking a case we imperatively update the symbols in the body of the case those symbols are bound by the symbols in the Binds in the pattern of the case, so, if we set the symbols in the case body, but not in the patterns, then re-type check the casedef (for a second try in typedApply for example -- SI-1832), we are no longer in sync: the body has symbols set that do not appear in the patterns since body1 is not necessarily equal to body, we must return a copied tree, but we must still mutate the original bind
| * | update docs for (partial) fun synth in uncurryAdriaan Moors2012-07-201-25/+24
| | |