summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util/package.scala
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in compiler and reflectJanek Bogucki2017-02-131-1/+1
| | | | | | | | | | | | Miscellania: Miscellania is a small island off the northernmost part of the Fremennik Isles - RunScape Wiki Miscellanea: A collection of miscellaneous objects or writings - Merriam-Webster
* SI-7933 REPL javax.script eval is cached resultRaphael Jolly2014-01-311-1/+12
| | | | | | | The problem is that the repl underneath the script engine evaluates input to val res0..resN, so it is a one shot operation. To allow repetition, compile(script) now returns a CompiledScript object whose eval method can be called any number of times.
* Removing deprecated code.Paul Phillips2013-11-181-32/+3
| | | | | Code which has been deprecated since 2.10.0 and which allowed for straightforward removal.
* Make parameters to implicit value classes privateJason Zaugg2013-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that they aren't offered as an autocomplete suggestion: implicit class Shouty(string: String) extends AnyVal { def SHOUT_! = string.toUpperCase + "!" } "". // autocompletion offers `.string` here The original incarnation of value classes didn't allow this sort of encapsulation, so we either invented goofy names like `__thingToAdd` or just picked `x` or `self`. But SI-7859 has delivered us the freedom to keep the accessor private. Should we keep any of these accessors around in a deprecated form? The implicit classes in Predef were added in 2.11.0-M2 (c26a8db067e4f), so they are okay. I think we can make reason that these APIs were both accidental and unlikely to be interpreted as public, so we can break them immediately. scala> Left(1).x res0: scala.util.Either[Int,Int] = Left(1) scala> import concurrent.duration._ import concurrent.duration._ scala> 1.n res1: Int = 1
* Removing unused code.Paul Phillips2013-10-021-3/+0
| | | | | | | Most of this was revealed via -Xlint with a flag which assumes closed world. I can't see how to check the assumes-closed-world code in without it being an ordeal. I'll leave it in a branch in case anyone wants to finish the long slog to the merge.
* SI-7781 REPL stack trunc shows causeSom Snytt2013-09-021-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handy stack trace truncation in REPL doesn't show cause like a regular trace. This commit fixes that and also adds the usual indicator for truncation, viz, "... 33 more". The example from the ticket produces: ``` scala> rewrapperer java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure at .rewrapper(<console>:9) at .rewrapperer(<console>:10) ... 32 elided Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure at .wrapper(<console>:8) ... 34 more Caused by: java.lang.RuntimeException: Point of failure at .sample(<console>:7) ... 35 more ``` Suppressed exceptions on Java 7 are handled reflectively. ``` java.lang.RuntimeException: My problem at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:56) ... 27 elided Suppressed: java.lang.RuntimeException: Point of failure at scala.tools.nsc.util.StackTraceTest.sample(StackTraceTest.scala:29) at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:54) ... 27 more ```
* SI-7740 Trim stack trace before printing in REPLChristoffer Sawicki2013-08-191-0/+9
|
* SI-7681 Clean up scala.reflect.internal.util.TableDefSimon Ochsenreither2013-07-201-6/+0
| | | | ... now that scala.tools.nsc.Phases is gone.
* Moves AbstractFileClassLoader to scala-reflect.jarEugene Burmako2013-05-201-0/+9
| | | | | | | | | Its string name was used in ReflectionUtils and became broken after repl got factored out. This hints that that classloader belongs to where it is used, i.e. to scala-reflect.jar. Moreover AbstractFile is defined in scala-reflect.jar, so it's only logical to also define a derived classloader in scala-reflect.jar.
* Absolutized paths involving the scala package.Paul Phillips2013-05-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* Rewrote FastTrack for clarity.Paul Phillips2012-12-231-1/+1
| | | | | | We can say what we wish to say with more directness and with fewer vars, levels of indirection, public members, and implicit conversions.
* Remove code from compiler central.Paul Phillips2012-11-201-20/+0
| | | | | All those old-timey methods whose melodies have become unfashionable.
* Revert "Commenting out unused members."Paul Phillips2012-11-191-11/+11
| | | | This reverts commit 951fc3a486.
* Commenting out unused members.Paul Phillips2012-11-191-11/+11
| | | | | | | | | | | | | | | | | | I want to get this commit into the history because the tests pass here, which demonstrates that every commented out method is not only unnecessary internally but has zero test coverage. Since I know (based on the occasional source code comment, or more often based on knowing something about other source bases) that some of these can't be removed without breaking other things, I want to at least record a snapshot of the identities of all these unused and untested methods. This commit will be reverted; then there will be another commit which removes the subset of these methods which I believe to be removable. The remainder are in great need of tests which exercise the interfaces upon which other repositories depend.
* A utility function to summarize an exception.Paul Phillips2012-11-091-0/+12
| | | | | | | | | | | | | Now when I start the repl and trigger an exception during initialization, it offers a one line message like: uncaught exception during compilation: AssertionError("assertion failed: (14,13)") @ scala.reflect.internal.Symbols$Symbol.updateInfo(Symbols.scala:1309) Which is a marked debugging improvement from RC1: uncaught exception during compilation: java.lang.AssertionError
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* More relative path elimination.Paul Phillips2012-09-151-1/+1
| | | | | | | | | | | | | | | | Some names I missed in 55b609458fd . How one might know when one is done: mkdir scratch && cd scratch mkdir annotation beans collection compat concurrent io \ math parallel ref reflect runtime scala sys testing \ text tools util xml scalac $(find ../src/library -name '*.scala') Until recently that would fail with about a billion errors. When it compiles, that's when you're done. And that's where this commit takes us, for src/library at least.
* update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* moves positions to scala.reflect.internal.utilEugene Burmako2012-06-081-0/+53
| | | | This is the first step of factoring out scala-reflect.jar.
* Enabling postfix ops feature warning, and working on libs to avoid them.Martin Odersky2012-04-121-0/+2
|
* Shutdown hook modification.Paul Phillips2011-10-181-7/+20
| | | | | | | | Don't mark shutdown hooks as daemon threads, although it does not seem to make any difference. Instead have the code which waits for all threads to be complete be smarted about which codes to monitor. No review.
* Getting liftCode to work.Martin Odersky2011-09-251-0/+4
|
* Moved scala.reflect.Chars to scala.reflect.inte...Iulian Dragos2011-05-201-1/+1
| | | | | | | | | | Moved scala.reflect.Chars to scala.reflect.internal.Chars, un-splitting the scala.reflect package. This is necessary for running in an OSGi container, such as Eclipse. A package may not be contributed by two different bundles (in this case the library and the compiler). It may be moved back when 'scala.reflect' exists only in one place. review by extempore.
* Added a forwarder for object Chars.Iulian Dragos2011-05-181-0/+3
|
* Renamed scala.reflect.common to scala.reflect.i...Paul Phillips2011-05-161-3/+3
| | | | | | | Renamed scala.reflect.common to scala.reflect.internal to better emphasize that it is not API. (The brush was overly broad, and some files now need to be rescued from being internal.) No review.
* Switched nsc.util to point to reflect.util, no ...Paul Phillips2011-05-161-0/+5
| | | | | Switched nsc.util to point to reflect.util, no review.
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Some fixes for partest issues.Paul Phillips2011-01-121-0/+1
| | | | | | | | prejudice and puts the new process code to work instead. There are still a couple bugs on my short term partest list. If this commit causes some weird issue which only arises on virtualized windows you can expect to hear from me next by postcard from st. lucia. No review.
* Imported sbt.Process into trunk, in the guise o...Paul Phillips2011-01-121-2/+2
| | | | | | | | | | | | | | | | | | | Imported sbt.Process into trunk, in the guise of package scala.sys.process. It is largely indistinguishable from the version in sbt, at least from the outside. Also, I renamed package system to sys. I wanted to do that from the beginning and the desire has only grown since then. Sometimes a short identifier is just critical to usability: with a function like error("") called from hundreds of places, the difference between system.error and sys.error is too big. sys.error and sys.exit have good vibes (at least as good as the vibes can be for functions which error and exit.) Note: this is just the first cut. I need to check this in to finish fixing partest. I will be going over it with a comb and writing documentation which will leave you enchanted, as well as removing other bits which are now redundant or inferior. No review.
* Eliminated 16 avoidable closure objects in Stream.Paul Phillips2011-01-041-0/+2
|
* Misc uninteresting tidbits to take some weight ...Paul Phillips2011-01-021-0/+3
| | | | | | Misc uninteresting tidbits to take some weight off overly large patches in progress. No review.
* Introducing scala.system, the product of a whir...Paul Phillips2010-12-041-22/+2
| | | | | | | | | | Introducing scala.system, the product of a whirlwind couple of hours. More useful stuff than you can shake three sticks at. See the scala.system package object. It's even documented. And since it has methods error and exit, proceeded to deprecate the ones in Predef. No review.
* Some cleanups in the *Runners and a few compile...Paul Phillips2010-11-271-0/+12
| | | | | | Some cleanups in the *Runners and a few compiler I/O conveniences. No review.
* Another exciting development in the world of -Y...Paul Phillips2010-11-131-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Introduces "Origins" for all your superhero bac...Paul Phillips2010-11-111-0/+11
| | | | | | | | Introduces "Origins" for all your superhero backstory needs. It logs where all the calls are coming from: that's all for the moment. It's explained in the comments and test case, so I'm sure you don't need it all repeated here. No review.
* Made scripts wait for all non-daemon threads to...Paul Phillips2010-06-071-0/+22
| | | | | | Made scripts wait for all non-daemon threads to exit before calling System.exit. Closes #1955, #2006, #3408. Review by community.
* Changed the script runner mechanism to alchemiz...Paul Phillips2010-05-231-0/+29
Changed the script runner mechanism to alchemize from AST atoms rather than generating wrapper source, and fixed script position reporting. This patch does not include a discussed change to mark some positions as synthetic. Closes #3119, #3121. Review by milessabin.