summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Updated jline and rebuilt.Paul Phillips2013-04-245-12/+12
| | | | | Two years of atrophy. Now using sbt 0.12.3 and latest versions of jansi, etc.
* Merge pull request #2284 from demobox/add-box-unbox-doc-commentJason Zaugg2013-04-2310-9/+59
|\ | | | | SI-6898 Document AnyVal box and unbox implemention by BoxesRunTime
| * SI-6898 Document AnyVal box and unbox implemention by BoxesRunTimeAndrew Phillips2013-04-229-9/+52
| | | | | | | | | | | | - Added @boxRunTimeDoc@ and @unboxRunTimeDoc@ tokens to AnyVals - Doc comments refer to BoxesRunTime.java in the Scala repo - No comment for Unit
| * Reverting changes to AnyVals generated classes in 9a82fc0Andrew Phillips2013-04-223-0/+7
| | | | | | | | - Since the generator was not changed, the classes no longer represent the generated versions
* | Merge pull request #2417 from paulp/pr/empty-type-boundsJason Zaugg2013-04-234-29/+24
|\ \ | | | | | | Simplify type bounds.
| * | Simplify type bounds.Paul Phillips2013-04-204-29/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I started out looking to limit the noise from empty type bounds, i.e. the endless repetition of class A[T >: _root_.scala.Nothing <: _root_.scala.Any] This led me to be reminded of all the unnecessary and in fact damaging overreaches which are performed during parsing. Why should a type parameter for which no bounds are specified be immediately encoded with this giant tree: TypeBounds( Select(Select(Ident(nme.ROOTPKG), tpnme.scala_), tpnme.Nothing), Select(Select(Ident(nme.ROOTPKG), tpnme.scala_), tpnme.Any) ) ...which must then be manually recognized as empty type bounds? Truly, this is madness. - It deftly eliminates the possibility of recognizing whether the user wrote "class A[T]" or "class A[T >: Nothing]" or "class A[T <: Any]" or specified both bounds. The fact that these work out the same internally does not imply the information should be exterminated even before parsing completes. - It burdens everyone who must recognize type bounds trees, such as this author - It is far less efficient than the obvious encoding - It offers literally no advantage whatsoever Encode empty type bounds as TypeBounds(EmptyTree, EmptyTree) What could be simpler.
* | | Merge pull request #2396 from som-snytt/issue/unmoored-docAdriaan Moors2013-04-226-45/+78
|\ \ \ | | | | | | | | SI-7376 Scaladoc warns when discarding local doc comments with API tags
| * | | SI-7376 Bad doc variable error is positioned at the variable.Som Snytt2013-04-171-1/+4
| | | | | | | | | | | | | | | | | | | | For a bad $variable, the caret is positioned at the variable in the doc instead of at the symbol being documented.
| * | | SI-7376 Additional trivial Scaladoc format correctionsSom Snytt2013-04-174-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | Horizontal rule is ---- not ==== (which means header). Sample dollars must be escaped.
| * | | SI-7376 Unmoored doc has correct positionSom Snytt2013-04-171-24/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unmoored DocComment is created more eagerly so that its position is correct despite subsequent line comments. (Previously, skipComment would advance docPos.) It looks like the error caret is still off by one when a doc comment shows up in the middle of an operator, and who doesn't scaladoc the interior of expressions? Another bug fixed by Paul's refactor is that additional comments between the doc and the entity no longer breaks the scaladoc. Test added.
| * | | SI-7376 Scaladoc warns when discarding local doc comments with API tagsSom Snytt2013-04-151-2/+38
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Double-star doc comments in non-dockable positions at the end of a block will emit a warning only if API tags like @author are present, or under -Xlint. A real comment parser is applied early to probe for tags, to minimize ad hoc testing or duplication, but warnings are suppressed. Residual ad hockiness lies in precisely which tags to warn on. Ad hoc or ad doc. This fix is a stop gap; a richer solution would also report about other doc locations that won't be processed.
* | | Merge pull request #2360 from ihji/bugfix/SI-7080Jason Zaugg2013-04-212-6/+15
|\ \ \ | | | | | | | | SI-7080 improve boundary value checking for BitSet
| * | | SI-7080 improve boundary value checking for BitSetHeejong Lee2013-04-072-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When BitSet accepts a very large integer such as Int.MaxValue, integer overflow possibly occurs in the calculation of boundary value "nwords * WordLength". This faulty boundary condition causes empty-iterator problem like following: scala> import collection.mutable.BitSet import collection.mutable.BitSet scala> val x = BitSet(Int.MaxValue) x: scala.collection.mutable.BitSet = BitSet() scala> x.iterator res0: Iterator[Int] = empty iterator
* | | | Merge pull request #2398 from huitseeker/silence_scaladoc_betterJason Zaugg2013-04-2111-14/+14
|\ \ \ \ | | | | | | | | | | Change unrecognized scaladoc comments to C-style
| * | | | Change unrecognized scaladoc comments to C-styleFrançois Garillot2013-04-1611-14/+14
| | |/ / | |/| |
* | | | Merge pull request #2426 from paulp/pr/7324Jason Zaugg2013-04-212-1/+9
|\ \ \ \ | | | | | | | | | | SI-7324 jvm not cool with 255+ parameters
| * | | | SI-7324 jvm not cool with 255+ parametersPaul Phillips2013-04-212-1/+9
| | | | | | | | | | | | | | | | | | | | Fail those monster methods rather than generating bad bytecode.
* | | | | Fixed BigDecimal documentation for primitive conversion methods.Alden Torres2013-04-211-4/+4
|/ / / /
* | | | Merge pull request #2361 from retronym/ticket/7337Jason Zaugg2013-04-201-2/+1
|\ \ \ \ | | | | | | | | | | SI-7337 Error out on missing -d directory.
| * | | | SI-7337 Error out on missing -d directory.Jason Zaugg2013-04-061-2/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This check was removed without comment in 3a30af154, the addition of JSR-223 support for the interpreter. After this commit, I manually tested that JSR-223 support works. scala> import javax.script._, collection.JavaConverters._; val manager = new ScriptEngineManager; manager.getEngineByName("scala").eval("List(1)") import javax.script._ import collection.JavaConverters._ manager: javax.script.ScriptEngineManager = javax.script.ScriptEngineManager@4418f61b res1: Object = List(1) 3a30af154 did not include a test case, so I don't know whether I've broken some other aspect of it. I tried the above as a `run` test, but hit two problems, one of them seemingly our fault, and the other a MacOS JDK wrinkle. 1. scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found. 2. java.lang.UnsatisfiedLinkError: no AppleScriptEngine in java.library.path I can't find my way to fix these, so JSR-223 remains untested. I don't think that commit was really up to standard; it could handle additional review, documentation, and testing. It might even be modularized so as not to pollute the REPL itself.
* | | | SI-7319 Remove unused method.Jason Zaugg2013-04-201-5/+0
| | | | | | | | | | | | | | | | Detritus spottend after merging SI-7319 from 2.10.x to master.
* | | | SI-7377 Remove special treatment of `stableFun()` in patterns.Jason Zaugg2013-04-201-56/+46
| | | | | | | | | | | | | | | | As promised in 15e9ef8f08.
* | | | Merge remote-tracking branch 'origin/2.10.x' into ↵Jason Zaugg2013-04-204-31/+43
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | merge/v2.10.1-245-g5147bb2-to-master Conflicts: src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * | | Merge pull request #2408 from paulp/pr/fully-qualified-namePaul Phillips2013-04-191-9/+12
| |\ \ \ | | | | | | | | | | Absolute path in error message.
| | * | | Absolute path in error message.Paul Phillips2013-04-171-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As soon as you have a directory called "language" lying around, you will appreciate why the advice given regarding SIP-18 should be "import scala.language..." not "import language..."
| * | | | Merge pull request #2411 from retronym/ticket/7388Paul Phillips2013-04-191-1/+5
| |\ \ \ \ | | | | | | | | | | | | SI-7388 Be more robust against cycles in error symbol creation.
| | * | | | SI-7388 Be more robust against cycles in error symbol creation.Jason Zaugg2013-04-181-1/+5
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Symbol#toString` was triggering `CyclicReferenceError` (specifically, `accurateKindString` which calls `owner.primaryConstructor`.) The `toString` output is used when creating an error symbol to assign to the tree after an error (in this case, a non-existent access qualifier.) This commit catches the error, and falls back to just using the symbol's name.
| * | | | Merge pull request #2402 from retronym/ticket/7377Paul Phillips2013-04-191-1/+6
| |\ \ \ \ | | | | | | | | | | | | SI-7377 Fix retypechecking of patterns on case companion alias
| | * | | | SI-7377 Fix retypechecking of patterns on case companion aliasJason Zaugg2013-04-171-1/+6
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some ancient code in Typers switches from PATTERNmode to EXPRmode when encountering `stableF(...)`. It just typechecks `stableF` and discards the arguments. To the best of Martin's recollection, this has something to do with the need to typecheck patterns rather late in the compiler, after `a.b` had been translated to `a.b()` in `Uncurry`. I'm not able to motivate this with tests using `-Xoldpatmat`; was there ever an even older pattern matcher that ran *after* uncurry? What changed in 2.10.1 to expose this wrinkle? dfbaaa17 fixed `TypeTree.copyAttrs` to copy the original tree. During the descent of `ResetAttrs`, sub-trees are duplicated before begin further transformed. Duplicating the `Match` in 2.10.0 would forget that the original tree of: pat = (a: Int)Foo(_) `----------` `- TypeTree((a: Int)Foo), with original Select(..., "FooAlias") The retypechecking would operate on the `MethodType`, rather than the `Select`, which was not considered a stable application. For 2.10.x, I've just tightened up the condition to only hit this if `args` is empty. I'm almost certain that the code can be removed altogether, and I'll do that when this is merged to master.
| * | | | Merge pull request #2370 from retronym/ticket/7319-2Paul Phillips2013-04-192-18/+14
| |\ \ \ \ | | | | | | | | | | | | SI-7319 Avoid unflushed error/warning buffers in startContext
| | * | | | SI-7319 Clear error buffer during Typer reset.Jason Zaugg2013-04-152-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contexts share error/warning buffers with their children, and this also applies ot the shared `startContext`. That context flushes the buffers in `startContext` in `resetContexts`. It also removes `typerReportAnyContextErrors`, which appears to be an elaborate no-op. It is only ever passed a context `c` which is a direct child of `this.context`. So taking a buffered error out of `c` and reissuing it into `this.context` merely re-inserts into into the same error buffer. Consrast this with `silent`, which uses a child context with a fresh error buffer. SI-7319 Flush error buffer in typerReportAnyContextErrors. After this change, we no longer rely on the backstop in resetContexts introduced in the previous commit.
| * | | | | Merge pull request #2364 from vigdorchik/ticket/si-7329Paul Phillips2013-04-191-1/+5
| |\ \ \ \ \ | | |_|/ / / | |/| | | | SI-7329 duplicate default getters for specialized parameters.
| | * | | | SI-7329 duplicate default getters for specialized parameters.Eugene Vigdorchik2013-04-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default getter is generated with @specialized annotation if the type parameter corresponding to the type of the parameter is specialized. Consequently specialize pass tries to generate overloads. Rather than pruning overloads to exclude duplicates, let's notice that default getter specialization is not needed at all: - The dynamic scope of default getter doesn't include specialized method or class constructor. - generic default getter is called even when calling specialized method: object V { @specialized def foo[@specialized B](b: B = (??? : B)) = {} foo[Int]() } gives: invokevirtual Method V$.foo$default$1:()Ljava/lang/Object; invokestatic (unboxToInt) invokevirtual Method V$.foo$mIc$sp:(I)V
* | | | | | Merge pull request #2382 from vigdorchik/remove_scaladoc_deprecationPaul Phillips2013-04-192-22/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove scaladoc deprecated option.
| * | | | | | Remove scaladoc deprecated option.Eugene Vigdorchik2013-04-102-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove -external-urls that had been previously deprecated in 2.10.
* | | | | | | SI-7314 Partest locates tools.jar and javacSom Snytt2013-04-182-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit lets partest locate tools.jar the way REPL does, with the addition that java.home.parent is also tried. The partest script will use JAVAC_CMD if set, or else JAVA_HOME, and will try the sibling of JAVACMD if set (on the theory that if you specify java, you are avoiding the path lookup and javac may also be in that special place), or else query the path for javac. The use cases are: no env vars, look around java.home; JDK or JAVA_HOME is set; JAVACMD is set; and finally tools.jar can live in jre/lib/ext and the fallback deep search will find it. These cases have been tried on cygwin with Java installed under s"Program${space}Files", which is usually the most brittle environment. That means tested with bash. The windows partest.bat has not been upgraded or side-graded.
* | | | | | | Merge pull request #2380 from paulp/pr/reifier-ast-testAdriaan Moors2013-04-152-13/+37
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Reifier -> AST Node test.
| * | | | | | | Reifier -> AST Node test.Paul Phillips2013-04-092-13/+37
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a Node-by-Node tour of the reifier's abilities and occasional foibles. That is one spectacularly attractive checkfile.
* | | | | | | Merge pull request #2336 from retronym/topic/deprecated-inheritance-tweakAdriaan Moors2013-04-152-3/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7312 @deprecatedInheritance now ignores same-file subclasses
| * | | | | | | SI-7312 @deprecatedInheritance now ignores same-file subclassesJason Zaugg2013-03-302-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to deprecate external inheritances as a prelude to sealing a class, without enduring the warnings ourselved in interlude.
* | | | | | | | Merge pull request #2368 from retronym/ticket/7335Adriaan Moors2013-04-157-127/+118
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7335 Simpler bootstrapping the standard library
| * | | | | | | | SI-7335 Remove special case for import of Predef._ in Predef.scalaJason Zaugg2013-04-131-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perhaps this once was problematic, but in our modern age we can bootstrap perfectly well with this import.
| * | | | | | | | SI-7335 Sharpen up comment about implicit prioritization.Jason Zaugg2013-04-081-2/+1
| | | | | | | | |
| * | | | | | | | SI-7335 Add logging for a now-impossible* case in Symbol#exists.Jason Zaugg2013-04-081-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Impossible (to the best of my knowledge) because LowPriorityImplicits is now defined in Predef.scala. Were I more sure, we could trip an assertion here, rather than the devWarning.
| * | | | | | | | SI-7335 Don't import Predef._ in Predef.scalaJason Zaugg2013-04-083-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check for this was foiled by the introduction of DeprecatedPredef in c26a8db0. This didn't cause any harm, but in any case this commit restores the intended state of affairs. The change is visible only through logging; no test case is included. qbin/scalac -Ydebug -Ylog:all src/library/scala/Predef.scala -Ystop-after:typer 2>&1 | grep -i "Omitted import of Predef" [log namer] Omitted import of Predef._ for Predef.scala [log typer] Omitted import of Predef._ for Predef.scala A redundant override of `firstDefinesClassOrObject` is also removed. Maybe we can remove the special case altogether?
| * | | | | | | | SI-7335 Mandate that parents of Predef must be defined in Predef.scalaJason Zaugg2013-04-083-95/+95
| | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids thorny issues of cyclic references and/or missing symbol errors due to the way Predef is completed earlier than user classes, and due to the addition of `import Predef._` to LowPriorityImplicits.scala. More details in Lukas's comments in [2]. How did we bootstrap originally? Manually ordering source files, either in the Ant Build [1], or later in Global [2]. But neither mechanism remains in place (due, I suppose, to the difficulty in defending them with a test case.) The reordering in Global was removed in [3]. After the change, we can compile the standard library without the results of a prior compilation run on the classpath. rm -rf target/locker/library/classes/scala && export LIB=build/pack/lib; java -Xmx1G -cp $LIB/scala-library.jar:$LIB/scala-reflect.jar:$LIB/scala-compiler.jar:$LIB/forkjoin.jar scala.tools.nsc.Main @args.txt src/library/scala/SerialVersionUID.scala:15: warning: Implementation restriction: subclassing Classfile does not make your annotation visible at runtime. If that is what you want, you must write the annotation class in Java. class SerialVersionUID(value: Long) extends scala.annotation.ClassfileAnnotation ^ warning: there were 75 deprecation warning(s); re-run with -deprecation for details warning: there were 1 unchecked warning(s); re-run with -unchecked for details warning: there were 5 feature warning(s); re-run with -feature for details four warnings found Where @args.txt contains: -classpath lib/forkjoin.jar:target/locker/library/classes -sourcepath src/library -d target/locker/library/classes src/library/scala/Function3.scala src/library/scala/Console.scala <more of src/library/**, unsorted> This change will break scala-virtualized, which will need to move the contents of StandardEmbeddings.scala into Predef.scala. [1] https://github.com/scala/scala/commit/c5441dc [2] https://github.com/scala/scala/commit/e72f0c7 [3] https://github.com/scala/scala/pull/968
* | | | | | | | Merge remote-tracking branch 'origin/2.10.x' into ↵Jason Zaugg2013-04-156-92/+54
|\ \ \ \ \ \ \ \ | | |_|_|/ / / / | |/| | | | | / | |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/v2.10.1-235-g4525e92-to-master Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/internal/Types.scala
| * | | | | | Merge pull request #2383 from vigdorchik/ticket/si-6286Paul Phillips2013-04-141-20/+17
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6286 IllegalArgumentException handling specialized method.
| | * | | | | | SI-6286 IllegalArgumentException handling specialized method.Eugene Vigdorchik2013-04-101-20/+17
| | | |_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specialize assigns SpecialOverride info to a specialized method even when there is a further specialization that should be forwarded to.
| * / | | | | SI-7360 Don't let a follow-up TypeError obscure the original error.Jason Zaugg2013-04-121-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When supplementing a fatal error message with context (current compilation unit, tree, phase, etcetera), we must be cautious to not to trigger another error which will obscure the original one. Currently, `supplementErrorMessage` does its working a try catch that only catches `Exception`. But this fails to catch CyclicReferenceError (<: TypeError <: Throwable), as was seen in a recent mailing list post by Greg Meredith. This commit extends the catch clause.