| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Avoid needless Type stringification when logging is disabled.
|
|/
|
|
|
|
|
| |
Since 4d6be05c28, we've been a tad wasteful in implicit searches.
This adds a by-name parameter to the local logging method to
avoid that.
|
|\
| |
| | |
Eliminate TypeTrees with null original.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a retry of #2801 after figuring out the range position
error. Should there be anyone out there who compiles with -Xdev,
know that this commit eliminates the 1406 errors one presently
incurs compiling src/library.
A val declared in source code receives only one tree from the
parser, but two are needed - one for the field and one for the
getter. I discovered long ago that if the val had an existential
type, this was creating issues with incompatible existentials
between the field and the getter. However the remedy for that
did not take into account the whole of the wide range of super
subtle issues which accompany tree duplication.
In particular, the duplicated tree must be given not only a
fresh TypeTree(), but that TypeTree cannot share the same
original without running afoul of range position invariants.
That's because typedTypeTree resurrects the original tree with
whatever position it has - so the "original" needs to be a
duplicate of the original with a focused position.
Should the call to TypeTree.duplicate also duplicate the original?
I think so, but I bequeath this question to others.
This commit also eliminated some duplicate error messages, because
duplicate suppression depends on the errors having the same position.
See c478eb770d, 7a6fa80937 for previous related work.
|
|\ \
| | |
| | | |
SI-7791 Line number table reflects underlying file
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since positions ultimately know their ultimate
positions in their ultimate source, use that line
number, ultimately, when emitting line number
table entries.
It is possible, but possibly not useful, to emit
both the actual (ultimate) line number and the
nominal one.
The `int`-valued line number of the `StackTraceElement`
is "derived" from the attribute.
In global, wrapping a `BatchSourceFile` as a
`ScriptSource` happens in `compileSources` to
facilitate testing.
A `ScriptTest` facility is provided to facilitate
testing the script facility. It is rather facile.
|
|\ \ \
| | | |
| | | | |
Alter TailRec to have map and flatMap
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As described in the "Stackless Scala with Free Monads" paper
scala> import scala.util.control.TailCalls._
import scala.util.control.TailCalls._
scala> :paste
// Entering paste mode (ctrl-D to finish)
def isEven(xs: List[Int]): TailRec[Boolean] =
if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail))
def isOdd(xs: List[Int]): TailRec[Boolean] =
if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail))
// Exiting paste mode, now interpreting.
isEven: (xs: List[Int])util.control.TailCalls.TailRec[Boolean]
isOdd: (xs: List[Int])util.control.TailCalls.TailRec[Boolean]
scala> isEven((1 to 100000).toList).result
res0: Boolean = true
scala> def fib(n: Int): TailRec[Int] =
| if (n < 2) done(n) else for {
| x <- tailcall(fib(n - 1))
| y <- tailcall(fib(n - 2))
| } yield (x + y)
fib: (n: Int)util.control.TailCalls.TailRec[Int]
scala> fib(40).result
res1: Int = 102334155
|
|\ \ \ \
| | | | |
| | | | | |
Correcting scaladoc for all classes defining withDefaultValue method.
|
| | | | |
| | | | |
| | | | |
| | | | | |
The description of the single parameter seems to be a copy and paste mistake from withDefault method.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-7805 REPL -i startup
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Tested with a ReplTest that loads an include script.
ReplTests can choose to be `Welcoming` and keep a
normalized welcome message in their check transcript.
One recent SessionTest is updated to use the normalizing API.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7643 Enable newPatternMatching in interactive.
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Without it, the enclosed test fails with:
ArrayBuffer(Problem(RangePosition(partial-fun/src/PartialFun.scala, 62, 62, 77),type mismatch;
found : Int => Int
required: PartialFunction[Int,Int],2))
And with that, we can remove this option altogether.
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
Modularize: xml & parser-combinators
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
That is, scaladoc is still in the scala-compiler artifact.
Let dbuild know so that it won't freak out.
ps: dbuild-meta.json should be kept in synch with
src/build/dbuild-meta-json-gen.scala until we can
automate that in the build
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This brings the external modules (xml, parsers)
back to the classpaths of build/(quick|pack)/bin/scala*.
Include the OSGIfied jars for external modules in dist.
(TODO: OSGI-fy externally)
Download javadoc/sources from maven and include in dist.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
To eliminate any delay between deploying partest to sonatype
and using it for development, we resolve it through sonatype.
Not acceptable for jars that ship as part of the release,
such as scaladoc (we'd see a jar others might not see).
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
These modules move to their own repositories:
- https://github.com/scala/scala-xml (v1.0-RC3)
- https://github.com/scala/scala-parser-combinators (v1.0-RC1)
The modularization depends on the new partest, as the old one's
classpath handling did not support a modularized scala.
The compiler pom now depends on the artifacts published separately,
with versions specified in versions.properties.
NOTES:
- The osgi tests resolve the xml and parsers jars and osgi-fy them,
as they are no longer built locally.
TODO: Can we move the osgification to the module builds?
- Disabled local repositories: don't want to accidentally include
unpublished artifacts in releases etc.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Every test deleted here has found its way to the respective
repositories of scala-xml and scala-parser-combinators,
where they will continue to be tested with partest.
The modified tests became independent of these modules,
as they should've been from the start.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Merge 2.10.x into master
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Conflicts:
bincompat-backward.whitelist.conf
bincompat-forward.whitelist.conf
src/reflect/scala/reflect/internal/SymbolTable.scala
src/reflect/scala/reflect/internal/util/WeakHashSet.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
typedAnnotated no longer emits nulls
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Adds a null-check in original synthesis for the result of typedAnnotated.
Previously it was possible for the aforementioned result to look like
TypeTree(<tpe>) setOriginal Annotated(..., null). Not anymore.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Backport #2605 to 2.10.x: SI-7149 Use a WeakHashSet for type uniqueness
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
perRunCaches was using a HashMap of WeakReferences which meant it would
accumulate WeakReferences over time. This commit uses a WeakHashSet
instead so that the references are cleaned up.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Currently type uniqueness is done via a HashSet[Type], but
that means the Types live through an entire compile session, even
ones that are used once. The result is a huge amount of unnecessarily
retained memory. This commit uses a WeakHashSet instead so that Types
and their WeakReferences are cleaned up when no longer in use.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Replaces scala.reflect.internal.WeakHashSet with a version that
* extends the mutable.Set trait
* doesn't leak WeakReferences
* is unit tested
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
SI-7782 Derive type skolems at the ground level
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Rather than at the current value of `skolemizationLevel`,
which could be influenced by an in-flight existential
subtype computation.
This method is called in `PolyTypeCompleter`, which
could be constructed by the lazy type completer of the
enclosing class. So currently it is closing over a mutable
variable; hence the Heisenbug.
This issue was exposed by the changes in b74c33eb860,
which was introduced in Scala 2.10.1.
|
| | |\ \ \ \ \ \ \ \ \
| | | |_|/ / / / / / /
| | |/| | | | | | | | |
SI-4760 Parser handles block-ending import
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Don't molest the RBRACE.
Updated with additional parse tests suggested
by @retronym. "What are you lazy?" Yes, I
must be lazy. Can't ScalaCheck or Par-Test
generate these tests automatically? That seems
like a reasonable expectation.
|
| | |\ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
SI-7790 No ScriptEngine in 2.10 build
|
| | | | |_|/ / / / / /
| | | |/| | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
The service entry was inadvertendly added in
`e3b5e0ba40447970d621cfeed5cc1770df69884f`,
"Sanity for build.xml: exscriptus&positus delendus est,"
which is ant latin for: "Reduced copy/pasting to the best
of my antabilities."
With that degree of hubris, it was inevitable that the
commit introduced a copy/paste bug. What is the Attic
Greek for copy/paste?
I'm pretty sure that in fifth century Athens they would
just pound one inscription to rubble using a bigger
inscription. They had slaves for that kind of work.
You never hear about Socrates tweaking the build script.
That's the reason he never wrote anything down.
|
| | |\ \ \ \ \ \ \ \ \
| | | |_|/ / / / / / /
| | |/| | | | | | | | |
[backport] Commit .gitignore directly
|
| | |/ / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Rather than relying on the cloner to copy the
provided gitignore.SAMPLE files.
This finishes the job started in c48509598, mostly
by reverting that commit and moving the two existing
SAMPLE files to the final destinations.
Use `.git/info/exclude` to augment the list of patterns
with entries specific to your workflow.
(cherry picked from commit b51cb581270da7021b2ea122dc059847101d56a7)
==============================================
Paring back the scope of our shared .gitignore
Importantly, limit the exclusion of build.properties
to the file in the root directory, paving the way for
the return of an SBT build.
- Unignores .bak, .jar, and ~
- limit ignorance of qbin to the root directory
.log files, generated by partest, are still ignored.
To see ignored files in your workspace, try:
git ls-files --others --ignored --exclude-standard -- test | grep log
git status --ignored -- test
(cherry picked from commit f0bbd2ca32acb40be37dc382c1f95081deca3f22)
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
SI-7775 Harden against the shifting sands of System.getProperties
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
If another thread writes a new system property (which can happen
in pretty innocuous code such as `new Date`!), the compiler startup
could fail with a `ConcurrentModificationException` as it iterated
all bindings in the properties map in search of a boot classpath
property for esoteric JVMs.
This commit uses `Properties#getStringProperties` to get a snapshot
of the keys that isn't backed by the live map, and iterates these
instead. That method will also limit us to bindings with String
values, which is all that we expect.
|
| | |\ \ \ \ \ \ \ \ \
| | | |_|/ / / / / / /
| | |/| | | | | | | | |
SI-7779 Account for class name compactification in reflection
|
| | | |/ / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
We have to assume that the classes we are reflecting on were
compiled with the default value for -Xmax-classfile-name (255).
With this assumption, we can apply the same name compactification
as done in the regular compiler.
The REPL is particularly prone to generating long class names
with the '$iw' prefixes, so this is an important fix for runtime
reflection.
Also adds support for getting the runtime class of `O.type` if
`O` is a module.
|
|\ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / /
|/| | | | | | | | | |
Change Scala license to unmodified 3-clause BSD.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
No longer using the slightly reworded 3-clause BSD license.
This does not change the meaning of the license,
just aligns it with the standard wording.
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|/ / / /
|/| | | | | | | | | |
SI-7781 REPL stack trunc shows cause
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Also, it would be nice if code and expected results were
calculated lazily. That would allow tests with infinite
code but which terminate on various conditions.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
The test should normalize the elided message,
not strip it. (Thanks qerub; I was frustrated
with kitteh's turnaround that night, hence
unwilling to improve once it passed.)
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
And all.clean will also junit.clean.
|
|/ / / / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
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-6240 Synchronizes Names
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Marking some methods as final. Once known to be overriden
in scala-ide are instead marked with @deprecatedOveriding.
This is to signal the new means of synchronization to
subclasses.
|