summaryrefslogtreecommitdiff
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Recognize java enums as constants from source.Paul Phillips2012-05-113-2/+12
| | | | | | Fixed up one of the mismatches between how java source is modeled and how java bytecode is modeled. We should get the rest of them too. Closes SI-2764.
*-. Merge commit 'refs/pull/527/head'; commit 'refs/pull/528/head'; commit ↵Paul Phillips2012-05-112-1/+17
|\ \ | | | | | | | | | 'refs/pull/529/head' into develop
| | * Fix for SI-5654.Lukas Rytz2012-05-101-1/+8
| | | | | | | | | | | | More details as code comment and in the bug database.
| * | Use TreeInfo#isSelfConstrCall, rather than the hand-rolled version.Jason Zaugg2012-05-111-1/+1
| | |
| * | Forbid forward refs from self constructor invocations.Jason Zaugg2012-05-111-0/+9
|/ / | | | | | | | | | | | | Prevents the wheels falling off during later compiler phases, or, worse, during bytecode verification. Closes SI-4098.
* | Merge commit 'refs/pull/526/head' into developPaul Phillips2012-05-101-1/+1
|\ \
| * | Fixed SI-5708. Correctly compute accessibility for object members.Iulian Dragos2012-05-101-1/+1
| | |
* | | Impl classes printed more accurately.Paul Phillips2012-05-101-1/+2
| | | | | | | | | | | | They're not traits.
* | | Quieted down a developer warning.Paul Phillips2012-05-101-1/+1
| | |
* | | Be discriminating about custom hashcodes.Paul Phillips2012-05-106-11/+17
| | | | | | | | | | | | If there are no primitives, use the regular boxy one.
* | | More useful crash reports.Paul Phillips2012-05-104-19/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you can't get your hands on something which crashes scalac - I know, I know - you can try this ready-made crasher. % cat test/pending/pos/t4717.scala trait Bounds[@specialized A] { // okay without `>: A` def x[B >: A]: Unit = new Bounds[B] { lazy val it = ??? // def or val okay it } } % scalac -d /tmp test/pending/pos/t4717.scala error: while compiling: test/pending/pos/t4717.scala during phase: specialize library version: version 2.10.0-20120510-134429-ce1d68ed19 compiler version: version 2.10.0-20120510-152646-ba4dfd1e63 reconstructed args: -d /tmp last tree to typer: Select(This(trait Bounds$mcZ$sp), x$mcZ$sp) symbol: method x$mcZ$sp in trait Bounds$mcZ$sp (flags: override <method> <specialized>) symbol definition: override def x$mcZ$sp[B >: Boolean](): Unit tpe: [B >: Boolean]()Unit symbol owners: method x$mcZ$sp -> trait Bounds$mcZ$sp -> package <empty> context owners: value it -> anonymous class $anon -> method x$mcZ$sp -> trait Bounds$mcZ$sp -> package <empty> == Enclosing template or block == Block( Assign( $anon.this."it " Apply( // def ???(): Nothing in object Predef, tree.tpe=Nothing scala.this."Predef"."$qmark$qmark$qmark" // def ???(): Nothing in object Predef, tree.tpe=()Nothing Nil ) ) $anon.this."it " // lazy private[this] var it: Nothing, tree.tpe=Nothing ) == Expanded type of tree == PolyType( typeParams = List(TypeParam(B >: Boolean)) resultType = NullaryMethodType( resultType = TypeRef(TypeSymbol(final class Unit extends AnyVal)) ) ) // And then the usual stack trace
* | | Tweak to deal with reflective mirror.Paul Phillips2012-05-101-1/+1
|/ / | | | | | | | | Stuff written during the era of "one symbol table" is surprised to find two.
| |
| \
*-. \ Merge commit 'refs/pull/522/head'; commit 'refs/pull/523/head' into developPaul Phillips2012-05-103-3/+11
|\ \ \
| | * | A bunch of fixes for positions when dealing with partial functionsHubert Plociniczak2012-05-101-3/+3
| | | |
| * | | Don't forget to execute pending interrupt requests when shutting down the ↵Iulian Dragos2012-05-102-0/+8
| | | | | | | | | | | | | | | | presentation compiler.
* | | | Custom hashCode methods for case classes.Paul Phillips2012-05-092-1/+35
| | | | | | | | | | | | | | | | No boxing, no MODULE$ indirection.
* | | | Fix an inference regression with this.type.Paul Phillips2012-05-091-2/+2
| | | | | | | | | | | | | | | | Closes SI-5210.
* | | | Restored portion of code removed in a7f68ce32c .Paul Phillips2012-05-092-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A hole in the net discovered by retronym makes me put back the former special casing of module class type inference; there's no reason to get it wrong. It appears that TypeRef(pre1, sym1, Nil) SingleType(pre2, sym2) are not seen as equivalent if they have different prefixes even if the prefixes should be equivalent. For now I'm leaving it; in principle this patch should eventually be reverted after subtyping and/or the representation of singleton types advances to the point that it isn't necessary. Closes SI-5777.
| | | |
| \ \ \
*-. | | | Merge commit 'refs/pull/517/head'; commit 'refs/pull/518/head'; commit ↵Paul Phillips2012-05-092-3/+12
|\ \| | | | | | | | | | | | | | | | | | 'refs/pull/519/head'; commit 'refs/pull/520/head' into develop
| | * | | fix SI-1247: don't create a thunk for a by-name argument if the argument ↵Johannes Rudolph2012-05-081-1/+9
| |/ / / |/| | | | | | | | | | | expression is a Function0 application
| * | | imporved comment related to SI-5178Lukas Rytz2012-05-091-2/+3
| | |/ | |/| | | | | | | see 9f9932bd20
| | |
| \ \
*-. \ \ Merge commit 'refs/pull/512/head'; commit 'refs/pull/513/head' into developPaul Phillips2012-05-087-46/+46
|\ \ \ \ | |_|_|/ |/| | |
| | * | Fixes SI-5564.Aleksandar Prokopec2012-05-081-8/+23
| | |/ | | | | | | | | | Catching typer errors in specialization.
| * | Fixed positions in named default applications (no hyperlinking in ↵Iulian Dragos2012-05-084-35/+19
| | | | | | | | | | | | | | | | | | conjunction with implicit arguments). Removed even more code in the presentation compiler testing infrastructure. One less level of indirection, and a top-level object gone!
| * | Making the locator more robust in the face of weird originals. And changed ↵Martin Odersky2012-05-082-3/+4
| |/ | | | | | | | | | | | | | | positions in AnnotationInfo to avoid position-less trees there. Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| |
| \
*-. | Merge commit 'refs/pull/510/head'; commit 'refs/pull/511/head'Paul Phillips2012-05-081-1/+1
|\ \|
| * | Appendix. Typo that wasn't covered by the test suite.Hubert Plociniczak2012-05-081-1/+1
| | |
| | |
| \ \
| \ \
| \ \
| \ \
| \ \
*-----. \ \ Merge commit 'refs/pull/504/head'; commit 'refs/pull/505/head'; commit ↵Paul Phillips2012-05-08149-1908/+38584
|\ \ \ \ \ \ | | | |_|/ / | | |/| | / | | |_|_|/ | |/| | | 'refs/pull/506/head'; commit 'refs/pull/507/head'; commit 'refs/pull/508/head' into develop
| | | | * GenASM activated via -target:jvm-1.6 or -target:jvm-1.5-asmMiguel Garcia2012-05-088-8/+3349
| | | | |
| | | | * glue ASM <-> GenASM, the only part of scala.tools.asm to maintain manuallyMiguel Garcia2012-05-082-0/+67
| | | | |
| | | | * subset of the ASM framework, re-namespaced as scala.tools.asmMiguel Garcia2012-05-0875-0/+27954
| | | | |
| | | | * documentation about BasicBlock and InlinerMiguel Garcia2012-05-082-16/+19
| | | | |
| | | | * BytecodeWriters can do without the FJBG dependencyMiguel Garcia2012-05-082-23/+30
| | | | |
| | | | * overriding rather than pattern matching in icode.OpcodesMiguel Garcia2012-05-081-29/+30
| | |_|/ | |/| |
| | * | Part IV of the Lazy Vals Saga: Optimized local vals. That's all folks.Hubert Plociniczak2012-05-083-45/+75
| | | |
| | * | Part III of the Lazy Vals Saga: Inliner strikes back. Or at least let's hope ↵Hubert Plociniczak2012-05-075-33/+77
| | | | | | | | | | | | | | | | it will.
| | * | Part II of the Lazy Vals Saga: Saving bitmap by the Three Musketeers: Byte, ↵Hubert Plociniczak2012-05-046-39/+83
| | | | | | | | | | | | | | | | Int and Long. And Boolean (hey, he also deserves some credit!).
| | * | Part I of the Lazy Vals Saga: Bitmaps are no longer inherited.Hubert Plociniczak2012-05-032-82/+6
| |/ / |/| |
| * | A little sketchiness in recent commit.Paul Phillips2012-05-081-1/+1
| |/ | | | | | | Retro-reviewing.
| * Fix for aliasing bug in reifier.Paul Phillips2012-05-081-9/+10
| | | | | | | | Closes SI-5769.
| * Merge commit 'refs/pull/491/head' into developPaul Phillips2012-05-071-13/+19
| |\
| | * Fixes SI-5629.Aleksandar Prokopec2012-05-071-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an additional argument to the unify method in specialization - `tparams`. When this parameter is set to `true`, unification is done over type parameters in poly types as well. Additionally, the unification in specialization now works over type bounds. This ensures that in the below example: trait Foo[@specialized(Int) A] { def bar[B <: A](b: B) {} } class IntFoo extends Foo[Int] { override def bar[B <: Int](b: B) {} } the method `bar` gets correctly determined as a method that needs a special override for its `bar$mcI$sp`.
| * | minor tag-related fixesEugene Burmako2012-05-078-31/+31
| |/
| * Don't admit primitive arrays as a generic Java varargs param.Jason Zaugg2012-05-052-1/+6
| | | | | | | | | | | | They were sneaking through as polymorphic Arrays and avoiding boxing. Closes SI-4216
| * Updated Symbol to record classfile origin.Paul Phillips2012-05-047-29/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change should be transparent to anything using sourceFile, unless it was drinking from the inheritance well too deeply. Rather than squander the already allocated field for every ClassSymbol not being compiled from source, I'm now populating it with the file representing the class. This will make a broad range of things easier, like debugging, issuing useful error messages, symbol invalidation, signature verification, you name it. def sourceFile - still returns only source code files def binaryFile - returns only class files def associatedFile - returns whatever is there, if anything Performance: I may be mistaken, but I believe this is a zero-impact change. No new fields are allocated; fields which were null now hold a useful reference. The reference is to a file instance which was already being allocated and already long-lived. Compare error messages: // Version 1 % scalac a.scala error: type _$1 is defined twice // Version 2 % scalac a.scala error: type _$1 is defined twice conflicting symbols both originated in file './foo/package.class' Note: this may be due to a bug in the compiler involving wildcards in package objects one error found Bonus for people who read commit logs. Try this in the repl after starting power mode. ListClass.info.members groupBy (_.associatedFile) foreach { case (k, vs) => println("%s\n %s\n".format(k, vs map (_.defString) mkString "\n ")) }
| * run patmat after typer, but not *right* afterAdriaan Moors2012-05-041-2/+4
| | | | | | | | sbt needs that spot right after type for its phase xsbt-api
| * Fix for one of the oldest open soundness bugs.Paul Phillips2012-05-042-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes SI-963, since it was one of my random 30 it won the prize. The trick after adding the stability check (which has been sitting there commented out for 3+ years) was that implicit search depended on the wrongness, because memberWildcardType would create scopes with members of the form ?{ val name: tp } And since a def shouldn't match that, fixing it broke everything until I flipped it around: memberWildcardType should be seeking ?{ def name: tp } It could also search for a mutable value: the relevant quality is that it not be stable so it doesn't have a tighter type than the members it hopes to match.
| * Fix for broken non-local returns.Paul Phillips2012-05-041-3/+11
| | | | | | | | | | Don't change the owner of a return if the new owner is nested inside the old owner. Closes SI-5612.
| * Fix for implicit class / value class collision.Paul Phillips2012-05-031-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | New this week, on SCALA. Implicit class: "Spin me up an implicit method with my name." Value class: "I need a companion object, pronto." Narrator: "All was well with this arrangement... UNTIL." What happens when these two wacky SIPs get together in the very same class? You'll laugh until, eventually, you cry! Weeknights at 9:30pm, only on SCALA. Closes SI-5667.
| * Pushing ClassfileParser toward a new day.Paul Phillips2012-05-035-302/+135
| | | | | | | | | | | | Removed JacoMetaATTR. Removed MetaParser.