summaryrefslogtreecommitdiff
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Parser relaxation so that one can name the type...Paul Phillips2010-11-301-13/+8
| | | | | | | Parser relaxation so that one can name the type variables in a constructor pattern match: this is a prerequisite to realizing the full potential of gadts. (Nothing new works here however.) No review.
* Found several minor thigns wrong with checkSens...Paul Phillips2010-11-303-22/+53
| | | | | | | Found several minor thigns wrong with checkSensible, which tries to issue warnings for comparisons which will always be true or false. No review.
* Deprecated the @serializable annotation, introd...Lukas Rytz2010-11-3012-41/+48
| | | | | | | | | | | | | | | | | | | Deprecated the @serializable annotation, introduce a new trait "scala.Serializable" which has to be extended instead (cross-platform). Known issues: - Companion objects of serializable classes (including case classes) are automatically made serializable. However, they don't extend "Serializable" statically because of the known difficulty (should be done before typing, but hard). - Writing "case class C() extends Serializable" gives "error: trait Serializable is inherited twice" - Functions are serializable, but don't extend Serializable dynamically (could be fixed by making FunctionN Serializable - shouldn't we?) Note that @SerialVersionUID continues to be an annotation; it generates a static field, which is not possible otherwise in scala. Review by dragos, extempore. Question to dragos: in JavaPlatform.isMaybeBoxed, why is there a test for "JavaSerializableClass"? Is that correct?
* It looks like the fix for #2318 was causing pro...Paul Phillips2010-11-302-4/+3
| | | | | | | It looks like the fix for #2318 was causing problems, so I gave it some more graceful failure. Leaving #2318 open because the implementation could still work harder to find the right method. No review.
* "I invite everyone to change this rule, and obs...Paul Phillips2010-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | | "I invite everyone to change this rule, and observe what breaks!" This much beloved comment from #1208 has been on my radar for two years. The worm has turned. Closes #1208. The inferred type of an object is now Foo.type instead of "object Foo". What once was this: scala> val x: Map[Int, Singleton] = Map(1 -> None) <console>:5: error: type mismatch; found : (Int, object None) required: (Int, Singleton) Now exudes a pleasing aura of workingness: scala> val x: Map[Int, Singleton] = Map(1 -> None) x: Map[Int,Singleton] = Map(1 -> None) No review.
* Adding some more unwrapping to unwrap. No review.Paul Phillips2010-11-281-2/+9
|
* Did some more polishing on the infamous partial...Paul Phillips2010-11-282-3/+7
| | | | | | Did some more polishing on the infamous partial function error message. No review.
* Moved sigint handler to InterpreterLoop and mad...Paul Phillips2010-11-284-17/+35
| | | | | | Moved sigint handler to InterpreterLoop and made it discriminate based on contents of current line. No review.
* Fleshed out the mock code a little further so i...Paul Phillips2010-11-282-1/+71
| | | | | | | | | | | | | | | | | | | Fleshed out the mock code a little further so it's easy for closures to become SAMs. // implicit not necessary, but improves fun factor scala> implicit def mkUFn(x: AnyRef) = scala.tools.reflect.UniversalFn(x) mkUFn: (x: AnyRef)scala.tools.reflect.UniversalFn scala> (() => 5*5*5).as[java.util.concurrent.Callable[Int]] res1: java.util.concurrent.Callable[Int] = <function1> scala> res1.call res2: Int = 125 No review.
* Some hardening of the repl's internals extracte...Paul Phillips2010-11-276-58/+98
| | | | | | Some hardening of the repl's internals extracted from a more interesting patch in progress. No review.
* Some cleanups in the *Runners and a few compile...Paul Phillips2010-11-277-17/+38
| | | | | | Some cleanups in the *Runners and a few compiler I/O conveniences. No review.
* Temporarily disabled varargs annotation on cons...Aleksandar Pokopec2010-11-271-7/+8
| | | | | | | Temporarily disabled varargs annotation on constructors. No review.
* Some work on error messages, somewhat based on ...Paul Phillips2010-11-262-20/+27
| | | | | | Some work on error messages, somewhat based on ideas in #3092. No review.
* Seeing if I can unbreak things without actually...Paul Phillips2010-11-263-35/+29
| | | | | | Seeing if I can unbreak things without actually removing the visible motivation for the whole exercise. No review.
* Making the installation of the repl sigint hand...Paul Phillips2010-11-263-8/+25
| | | | | | | Making the installation of the repl sigint handler take place less eagerly. And more relevantly to recent hangs, made the repl only create daemon threads. No review.
* A new totally safe signal manager, along with a...Paul Phillips2010-11-2610-80/+385
| | | | | | | | | | | | | | | | | | | A new totally safe signal manager, along with all the support code needed for that. See the classes in scala.tools.reflect.* for interesting new weapons. Also includes inaugural handy usage: scala> val x = 10 x: Int = 10 scala> while (true) () [ctrl-C] Execution interrupted by signal. scala> x res1: Int = 10 No review, but feedback welcome.
* Adapt nested objects properly.Hubert Plociniczak2010-11-261-5/+4
|
* I keep forgeting which phase the browser is cur...Hubert Plociniczak2010-11-264-9/+8
| | | | | | I keep forgeting which phase the browser is currently showing, so added phase name. No review
* Further work on #3621.Aleksandar Pokopec2010-11-261-9/+9
| | | | | No review.
* In the absence of known reasons why some except...Paul Phillips2010-11-262-10/+5
| | | | | | | | In the absence of known reasons why some exceptions are intercepted or have their stack trace printed and others fly unchallenged, changed script and object runners to handle everything consistently when an exception is thrown. Closes #3978 again, no review.
* Temporarily reverted sun.misc.* using code unti...Paul Phillips2010-11-252-7/+10
| | | | | | Temporarily reverted sun.misc.* using code until reflective version is complete. No review.
* Further fixes some issues for #3621.Aleksandar Pokopec2010-11-251-3/+15
| | | | | Review by Rytz.
* Changing EnclosingMethod generation not to drop...Paul Phillips2010-11-251-1/+0
| | | | | | | | | Changing EnclosingMethod generation not to drop the trailing $ from the name of the container class. I'm sure this was done for some reason but proguard objects rather strenuously (and fails) because it can't find the method, since it says it's in the class but is really in the object. Review by dragos.
* Fix for #3621.Aleksandar Pokopec2010-11-246-9/+126
| | | | | | | Added varargs annotation. Review by Rytz.
* Quickfix for #3993 before a real fix is done.Eugene Vigdorchik2010-11-241-1/+1
|
* Added Presentation compiler stress tester.Martin Odersky2010-11-231-0/+204
|
* Some cleanup (mainly in Typers).Hubert Plociniczak2010-11-225-55/+27
|
* Make interrupts non-interruptible, otherwise th...Eugene Vigdorchik2010-11-211-1/+7
| | | | | | Make interrupts non-interruptible, otherwise the interrupt exception can just go direct to the user (IDE). Review by odersky.
* A little IDE hardeningMartin Odersky2010-11-201-1/+3
|
* removed duplicated error message for bad compil...michelou2010-11-181-2/+3
| | | | | | removed duplicated error message for bad compiler options made some cleanups in detach plugin code
* Improvements forMSIL: Miguel Garcia2010-11-182-25/+88
| | | | | | | | | | (1) the Scala types in ch.epfl.lamp.compiler.msil.emit now use Scala collections instead of Java's, (2) a few bug fixes regarding metadata parsing, (3) GenMSIL emits output useful for IDE debugging, (4) TypeParser now enters symbols for generics in case the assemblies being linked sport them, (5) a few fixes for bytecode verif in GenMSIL. review by rytz
* Some refinement of the error messages when the ...Paul Phillips2010-11-182-49/+93
| | | | | | | | | | | | | | | | | Some refinement of the error messages when the found and required types have the same simple names. No longer must we watch people scratch their heads at such messages as: found : scala.collection.Set[String] required: Set[String] Now so clear you could enjoy a movie through it: found : scala.collection.Set[String] required: scala.collection.immutable.Set[String] No review.
* updates Scala examples, added detach pluginmichelou2010-11-171-1/+0
|
* Two annoying REPL things made less annoying:Paul Phillips2010-11-174-5/+126
| | | | | | | | | * ctrl-C will no longer kill the repl unless you hit it again * ctrl-Z will no longer make the repl useless because of jline In the service of the first I wrote signal handling code, which we can put to use in other ways as well. No review.
* Some profiling infrastructure.Paul Phillips2010-11-164-6/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | I avoided creating any dependency on yourkit. In addition, there was no way to give arguments to the JVM without losing the ones defined in ANT_OPTS, which has been a massive pain for a while. So there is now "jvm.opts" which is simply appended to ANT_OPTS, e.g. % ant -Djvm.opts=-verbose [echo] Forking with JVM opts: -Xms1536M -Xmx2g -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC -verbose There is a minimal stub defining a profiler interface: scala.tools.util.Profiling Then the yourkit wrapper implements that interface. Once your locker has been rebuilt once, you can do this: ant yourkit.run And it will build quick.lib/comp with profiling enabled, assuming it can find the necessary files. See the yourkit.init target for values to change: or ant -Dyourkit.home=/path/to/it might be enough. Review by dragos.
* Correct wrong comment. No review.Eugene Vigdorchik2010-11-161-1/+1
|
* Added and corrected existing comments.Iulian Dragos2010-11-162-1/+4
|
* ant, build.xml and classpath issues.Paul Phillips2010-11-162-1/+1
| | | | | | | | | | | | | | been ignoring their painstakingly set classpaths and using whatever they can find in the vicinity of the scala script, which works OK for pack but not so well for quick. I also added a build.xml feature so you can drop jars into a dir and have them automatically used everywhere. The directory is lib/extra. Pro tip: add lib/extra to .gitignore and put jars like yjp-controller-api-redist.jar in there. Closes #3706, no review.
* Cosmetic changes to previous fix for #3918.Iulian Dragos2010-11-151-2/+2
|
* Clear the undoLog for types in resetTyper.Iulian Dragos2010-11-152-2/+3
| | | | | | a memory leak when running scalac in resident mode (including the presentation compiler and build manager). no review.
* Revert unused code.Eugene Vigdorchik2010-11-151-1/+1
|
* adapt not to confuse types and stable terms.Eugene Vigdorchik2010-11-151-1/+1
|
* Fixed -Xexperimental and other settings so that...Paul Phillips2010-11-141-3/+3
| | | | | | Fixed -Xexperimental and other settings so that setting them false will falsify the associated options rather than truify them. No review.
* Fix InnerClasses attribute: anonymous classes d...Iulian Dragos2010-11-133-17/+49
| | | | | | | | Fix InnerClasses attribute: anonymous classes don't have an outer name. EnclosingMethod is correctly generated. Fixed isAnonymousClass definition. Updated test that depends on anonymous inner class names. Closes (again) #3249, references #2749. review by odersky,extempore.
* Fixed erasure.intersectionDominator.Iulian Dragos2010-11-131-1/+2
| | | | | | is loaded before testing for 'isTrait'. closes #3918, review by odersky,extempore.
* Another exciting development in the world of -Y...Paul Phillips2010-11-1318-55/+571
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another exciting development in the world of -Y options which I and three other people will use. Today's is -Yrich-exceptions. Use it like so: SOURCEPATH=/path/to/src scalac -Yrich-exceptions a.scala In the repl, -Yrich-exceptions will cause lastException to be bound to an Exceptional instead of old rusty Throwable. That spins up new powers: scala> Nil.head [Nil.head] (List.scala:389) (access lastException for the full trace) scala> lastException.show /* The repl internal portion of the stack trace is elided. */ [Nil.head] 386: override def isEmpty = true 387: override def head: Nothing = 388: throw new NoSuchElementException("head of empty list") *389: override def tail: List[Nothing] = 390: throw new UnsupportedOperationException("tail of empty list") 391: // Removal of equals method here might lead to an infinite recursion similar to IntMap.equals. 392: override def equals(that: Any) = that match { [line0.<init>] (<console>:6) [line0.<clinit>] (<console>:-1) Also try "lastException.showTable" but this is getting a little long for more excerpt. No review.
* Generate EnclosingMethod classfile attributes. Iulian Dragos2010-11-124-4/+16
| | | | | | | | This should fix java signatures when they refer to method type parameters. I unrolled Adriaans previous fix for #3249, as this one is more general. Closes #3249, review by moors.
* A revival of r21442, which I had reverted based...Paul Phillips2010-11-121-2/+2
| | | | | | A revival of r21442, which I had reverted based on the mistaken belief it was causing mysterious trunk issues of the day. No review.
* Half of an implementation of sealedness for jav...Paul Phillips2010-11-122-5/+20
| | | | | | | | | Half of an implementation of sealedness for java enums. Since it's only half it's behind -Xexperimental, but it works like a charm for the half where it works (that being compiling against bytecode.) Need input on how to approach the source half. References ticket #2442. Review by moors.
* Some more work on options related to showing co...Paul Phillips2010-11-116-111/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some more work on options related to showing compiler structures during compilation. The pickler knew more than was healthy about things like compiler settings, so I let the pickler worry about pickling and moved that logic somewhere closer to the surface. Some convenience oriented tweaks to command line phase parsing. The end result is as follows (some output trimmed for brevity.) // dippy.scala class Dippy { def f[T <: Dippy](x: T) = (x, x) object DingusDippy extends util.Random { } } // className@phaseString should be reliably unambiguous % scalac -Xshow-class Dippy@typer,erasure,jvm dippy.scala <<-- class Dippy after phase 'typer' -->> Members (excluding Any/AnyRef unless overridden): final object DingusDippy extends object Dippy.this.DingusDippy def f[T <: Dippy](x: T): (T, T) <<-- class Dippy after phase 'erasure' -->> Members (excluding Any/AnyRef unless overridden): private lazy var DingusDippy$module: object Dippy#DingusDippy lazy val DingusDippy(): object Dippy#DingusDippy def f(x: Dippy): Tuple2 <<-- class Dippy after phase 'jvm' -->> Members (excluding Any/AnyRef unless overridden): protected var bitmap$0: Int private lazy var DingusDippy$module: object Dippy$DingusDippy lazy val DingusDippy(): object Dippy$DingusDippy def f(x: Dippy): Tuple2 No review.