| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Code which has been deprecated since 2.10.0 and which allowed
for straightforward removal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
```
|
| |
|
|
|
|
| |
... now that scala.tools.nsc.Phases is gone.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
We can say what we wish to say with more directness
and with fewer vars, levels of indirection, public members,
and implicit conversions.
|
|
|
|
|
| |
All those old-timey methods whose melodies have become
unfashionable.
|
|
|
|
| |
This reverts commit 951fc3a486.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
```
|
|
|
|
| |
This is the first step of factoring out scala-reflect.jar.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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 review.
|
| |
|
|
|
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
|
|
|
| |
Misc uninteresting tidbits to take some weight off overly large patches
in progress. No review.
|
|
|
|
|
|
|
|
|
|
| |
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 compiler I/O conveniences. No
review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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 exit before calling
System.exit. Closes #1955, #2006, #3408. Review by community.
|
|
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.
|