diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-04-11 09:05:45 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-04-11 09:05:45 +0000 |
commit | 825f3691fae26d3cc54dc04b4a559d197c46f780 (patch) | |
tree | 85ec520f743d57148ca2bd9b5c777832e4281e1e /test/files | |
parent | 74a967da857ead23ec5d976c6616ac98fb7c33ef (diff) | |
download | scala-825f3691fae26d3cc54dc04b4a559d197c46f780.tar.gz scala-825f3691fae26d3cc54dc04b4a559d197c46f780.tar.bz2 scala-825f3691fae26d3cc54dc04b4a559d197c46f780.zip |
Merged revisions 24573,24583-24584,24592-24604,...
Merged revisions
24573,24583-24584,24592-24604,24607-24612,24614-24646,24648,24651-24667,
24672-24706,24708-24717,24719-24724 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r24573 | dragos | 2011-03-24 18:48:14 +0100 (Thu, 24 Mar 2011) | 1 line
Added synchronous version of askStructure, needed by the IDE to avoid
deadlocks. review by odersky. ........ r24583 | magarcia | 2011-03-25
15:40:35 +0100 (Fri, 25 Mar 2011) | 3 lines
for Scala.NET bootstrapping. Given that flatten does not run in
forMSIL mode, there may be several recursive activations of the case
clause, and part of that activation state needs to be saved/restored.
forJVM behavior remains unchanged.
........
r24584 | extempore | 2011-03-25 15:49:31 +0100 (Fri, 25 Mar 2011) | 5 lines
I guess windows can show a < 500x difference and still give us
confidence there isn't a 100,000x difference. Testing situation
continues to confound and amaze. Trying to make 4279 not fail on
windows, one more time and I will delete it and burn the bodies. No
review. ........ r24592 | extempore | 2011-03-25 22:13:52 +0100 (Fri, 25
Mar 2011) | 3 lines
Figured out why -Ydebug has been such a deathtrap for a while. I'm
the culprit. Making -Ydebug less likely to kill a compile, no review.
........ r24593 | extempore | 2011-03-25 22:21:27 +0100 (Fri, 25 Mar
2011) | 2 lines
Fixed the "poor resilience to error conditions" crasher mentioned in
#3625, no review. ........ r24594 | kzys | 2011-03-25 23:55:19 +0100
(Fri, 25 Mar 2011) | 2 lines
[scaladoc] Stop wiki syntax parsing inside HTML. Review by pedrofurla.
........ r24595 | kzys | 2011-03-26 00:08:19 +0100 (Sat, 26 Mar 2011) |
2 lines
[scaladoc] Add a test for #4180. No review.
........
r24596 | kzys | 2011-03-26 01:39:35 +0100 (Sat, 26 Mar 2011) | 2 lines
[scaladoc] Fix wiki formatting to close #4359. Review by malayeri.
........ r24597 | kzys | 2011-03-26 02:25:13 +0100 (Sat, 26 Mar 2011) |
2 lines
[scaladoc] Closes #4371. Review by pedrofurla.
........
r24598 | kzys | 2011-03-26 04:26:40 +0100 (Sat, 26 Mar 2011) | 2 lines
[scaladoc] Cleanup tests. No review.
........
r24599 | extempore | 2011-03-26 17:05:14 +0100 (Sat, 26 Mar 2011) | 2 lines
Fix for cygwin: jline.UnixTerminal is now
scala.tools.jline.UnixTerminal. No review. ........ r24600 | extempore |
2011-03-26 19:22:27 +0100 (Sat, 26 Mar 2011) | 2 lines
Added some explanatory output when jline reader fails to create. No
review. ........ r24601 | extempore | 2011-03-26 20:42:25 +0100 (Sat, 26
Mar 2011) | 1 line
Some accumulated work and polish on classpath and jars. No review.
........ r24602 | extempore | 2011-03-26 20:42:44 +0100 (Sat, 26 Mar
2011) | 1 line
Cleaning up util.Tracer and its usage in Erasure. No review. ........
r24603 | extempore | 2011-03-26 20:43:00 +0100 (Sat, 26 Mar 2011) | 3
lines
Suppressed unnecessary checkcasts on Throwables which were letting
AnyRefs reach the backend. Looks like this was my doing when trying to
wake back up the icode checker. Closes #4393, no review. ........ r24604
| cunei | 2011-03-26 21:47:47 +0100 (Sat, 26 Mar 2011) | 4 lines
Introducing xz compression in nightly builds.
Also removed some obsolete targets related to the old 1.4 version.
........ r24607 | magarcia | 2011-03-27 16:41:46 +0200 (Sun, 27 Mar
2011) | 2 lines
needed when compiling the (jdk2ivkm'd) Scala library with Scala.NET,
and doesn't hurt in forJVM mode. ........ r24608 | extempore |
2011-03-27 17:37:15 +0200 (Sun, 27 Mar 2011) | 1 line
Made :javap less crashy on windows, no review.
........
r24609 | extempore | 2011-03-27 21:46:12 +0200 (Sun, 27 Mar 2011) | 18 lines
Fix for linked lists closes #4080 and proves my desire not to ship
obviously broken code is even greater than my will to hold out for any
help. I threw in a free fix for this which I noticed while in there.
scala> scala.collection.mutable.LinkedList[Int]().head
res0: Int = 0
Also was reminded how useless tests can be:
val ten = DoubleLinkedList(1 to 10: _*)
ten.insert(DoubleLinkedList(11))
// Post-insert position test
require(ten.last == 11)
Fortunately a test confirming buggy behavior still serves a purpose
by breaking when you fix the bug which allowed it to pass, thus letting
you fix the broken test too. Life's (very) little compensations. Linked
list code should still be presumed broken. No review. ........ r24610 |
extempore | 2011-03-28 01:27:05 +0200 (Mon, 28 Mar 2011) | 16 lines
Trying to get fsc doing the right thing with respect to absolute and
relative paths. My knowledge of the problem had heretofore been second
hand, and my understanding of it incomplete. The real problem I have
determined is that there are a bunch of different things which go
wrong if relative paths start being resolved from a different base,
each of which needs custom handling.
classpath-style options, e.g. fsc -cp ../foo.jar path-style options,
e.g. fsc -d ../mydir file arguments, e.g. fsc ../foo.scala
So it was more work than I had realized, or I probably wouldn't have
even touched it. But now it seems to be working as one would want. I
also poured some readability onto the fsc help output.
Closes #4395, no review, but community input would be great. ........
r24611 | extempore | 2011-03-28 05:10:44 +0200 (Mon, 28 Mar 2011) | 2
lines
A paltry 570 cases failing in -Xcheckinit due to some uninitialized
val or other. It is but a trifle! No review. ........ r24612 | extempore
| 2011-03-28 09:34:04 +0200 (Mon, 28 Mar 2011) | 4 lines
Learned an interesting lesson about having an implicit object with a
"def apply(x: Any): List[String]" method imported into power mode. Let's
just say this is not advised. This and other rough edges eliminated from
power mode, no review. ........ r24614 | magarcia | 2011-03-28 15:59:16
+0200 (Mon, 28 Mar 2011) | 1 line
(1) The msil library can now parse modreq and modopt, (2) bug fix in
GenMSIL. review by rytz. Updated msil.jar coming soon. ........ r24615 |
magarcia | 2011-03-28 18:00:13 +0200 (Mon, 28 Mar 2011) | 1 line
msil.jar updated with changeset 24614
........
r24616 | plocinic | 2011-03-28 18:21:52 +0200 (Mon, 28 Mar 2011) | 1 line
Don't analyse symbols with error types. can happen for java symbols
that are forced during the analysis. Partial fix for #1000238 in eclipse
ide, related issue is in #4402. no review ........ r24617 | kzys |
2011-03-28 18:58:54 +0200 (Mon, 28 Mar 2011) | 2 lines
[scaladoc] Remove whitespace around colon and parentheses. Closes
#4372. Review by pedrofurla. ........ r24618 | extempore | 2011-03-28
21:20:58 +0200 (Mon, 28 Mar 2011) | 3 lines
Added some implicitNotFound annotations to commonly used classes,
and some documentation to Manifest. (Said documentation is invisible
for the moment due to #4404.) No review. ........ r24619 | extempore |
2011-03-28 22:07:02 +0200 (Mon, 28 Mar 2011) | 2 lines
Expanding the test which tries to use the collections from java. No
review. ........ r24620 | extempore | 2011-03-28 23:44:33 +0200 (Mon, 28
Mar 2011) | 2 lines
Looks like another java5/java6 difference gets me on a test. At least
this time I was looking for that. No review. ........ r24621 | extempore
| 2011-03-28 23:53:12 +0200 (Mon, 28 Mar 2011) | 3 lines
Removed some bitrotted ant directives which were keeping us from
getting Manifest docs. Thanks to dmharrah. Also removed RichUnit, fare
thee well. Closes #4404, no review. ........ r24622 | extempore |
2011-03-28 23:57:47 +0200 (Mon, 28 Mar 2011) | 4 lines
Eliminated option -Xwarninit, which is warning about a change which
took place 2.5 years ago and is only likely to add to option confusion
at this point. No review. (But let me know if we still need this for
some reason: many more of our options should be culled.) ........ r24623
| extempore | 2011-03-29 00:45:53 +0200 (Tue, 29 Mar 2011) | 3 lines
Made ScalaRunTime.stringOf more general by separating out the part
which formats it for a repl result, and cleaned up some string functions
around the repl. No review. ........ r24624 | extempore | 2011-03-29
04:59:31 +0200 (Tue, 29 Mar 2011) | 26 lines
Polishing the programmatic interface to the repl and other bits
of machinery which we'll have to live with for a while. The repl
classloader now works more like you'd expect a classloader to, as seen
here:
% scala -Dscala.repl.power
scala> class Bippus extends Traversable[Int] { def foreach[U](f: Int => U) = () }
defined class Bippus
scala> intp.classLoader.getResourceAsStream("Bippus").bytes()
res0: Array[Byte] = Array(-54, -2, -70, ...
scala> res0.size
res1: Int = 23954
scala> case class Bippy(x: Int)
defined class Bippy
// classBytes is shorter way to say the same thing scala>
intp.classLoader.classBytes("Bippy").size
res2: Int = 2356
scala> intp.classLoader.classBytes("Bippy$").size
res3: Int = 1741
Closes #4399, no review.
........
r24625 | extempore | 2011-03-29 05:25:38 +0200 (Tue, 29 Mar 2011) | 1 line
And so my attempt to have a performance test draws the final curtain,
no review. ........ r24626 | kzys | 2011-03-29 16:55:30 +0200 (Tue, 29
Mar 2011) | 2 lines
[scaladoc] Add a test of colon and parentheses (#4372). No review.
........ r24627 | kzys | 2011-03-29 17:40:21 +0200 (Tue, 29 Mar 2011) |
2 lines
[scaladoc] Cleanup code. No review.
........
r24628 | kzys | 2011-03-29 18:21:02 +0200 (Tue, 29 Mar 2011) | 2 lines
[scaladoc] Don't create broken link to private companion object.
Closes #4374. Review by pedrofurla. ........ r24629 | extempore |
2011-03-29 20:41:08 +0200 (Tue, 29 Mar 2011) | 5 lines
A bunch of scaladoc cleanups. Tags with the wrong name, tags in the
wrong places, tags saying the wrong thing. I sorted types and values
so deprecated ones are at the end. I think they should be hidden by
default, but this is a big improvement. Leaving #3914 open so they can
be made invisible. No review. ........ r24630 | extempore | 2011-03-29
22:22:22 +0200 (Tue, 29 Mar 2011) | 2 lines
Disabled all the script tests. They're not run from ant and they're
breaking the distribution build. No review. ........ r24631 | extempore
| 2011-03-29 22:22:40 +0200 (Tue, 29 Mar 2011) | 2 lines
Fixing the scalap test rig to work like other test types so it doesn't
break the distribution build. No review. ........ r24632 | extempore |
2011-03-29 22:22:53 +0200 (Tue, 29 Mar 2011) | 2 lines
Transcript pastes now work with leading whitespace (such as my commit
message in r24624), no review. ........ r24633 | extempore | 2011-03-29
22:44:33 +0200 (Tue, 29 Mar 2011) | 2 lines
A change to a test to defend against output change when run with a
plugin enabled. No review. ........ r24634 | cunei | 2011-03-29 23:18:34
+0200 (Tue, 29 Mar 2011) | 2 lines
include files/specialized/*.txt in the set of files packaged in the
test sbp. ........ r24635 | cunei | 2011-03-29 23:39:29 +0200 (Tue, 29
Mar 2011) | 2 lines
Excluding presentation test from sbaz-packaged test suite. ........
r24636 | extempore | 2011-03-30 02:55:20 +0200 (Wed, 30 Mar 2011) | 11
lines
Wanting to deprecate -make, first I had to write a way to deprecate
-make. So there's that, now you can do
val s = SomeSetting(...) withDeprecationMessage "don't use this"
And it will do the usual deprecation things. And, deprecated -make.
And couldn't resist fixing a bug in -make, it would crash if you gave
it its own default option (i.e. -make:all.) Let's deprecate more!
I also did further cleaning up of our help outputs. Do I smell a
pulitzer in the making? No review. ........ r24637 | rytz | 2011-03-30
09:06:08 +0200 (Wed, 30 Mar 2011) | 1 line
fix get-scala-revision script for the case when svn prints some
warnings. no review ........ r24638 | extempore | 2011-03-30 22:40:46
+0200 (Wed, 30 Mar 2011) | 10 lines
Issue warning when doccomments have $variables which go unfulfilled.
Started with patch by dmharrah. Noticed expandVariables never
incremented its recursion guard and ended up rewriting it. To avoid
spurious warnings you can escape $'s, as in this comment:
/** The decoded name of the symbol, e.g. `==` instead of `\$eq\$eq`.
*/
The above will be ignored during expansion and translated to $eq$eq
for output. Closes #4412, no review. ........ r24639 | extempore |
2011-03-30 23:00:08 +0200 (Wed, 30 Mar 2011) | 2 lines
Addressing most of the warnings revealed by the patch to warn about
unknown scaladoc variables. Updated and reran genprod. No review.
........ r24640 | extempore | 2011-03-31 00:47:00 +0200 (Thu, 31 Mar
2011) | 3 lines
Warn about unqualified names in scaladoc links because they don't
work. I think it would be better to just make them work, but the way
things are structured it looks involved. Closes #3696, no review.
........ r24641 | kzys | 2011-03-31 01:38:18 +0200 (Thu, 31 Mar 2011) |
2 lines
[scaladoc] Scaladoc should expand macros recursively. Closes #3484.
Review by dubochet. ........ r24642 | extempore | 2011-03-31 05:59:42
+0200 (Thu, 31 Mar 2011) | 6 lines
Modified some typer logic to allow annotation arguments for constants
which don't have the form Literal(_). The current logic seems to be
avoided most of the time, but scaladoc breaks when it runs into it. This
closes #4301. I can't figure out from the ticket what the deal is with
#2764 and what is presently happening, but it seems like this patch
could only improve the situation. Review by rytz. ........ r24643 |
extempore | 2011-03-31 05:59:57 +0200 (Thu, 31 Mar 2011) | 2 lines
Incidental work on scaladoc while trying to figure out what is up with
usecases. Did a little rewrite of recent patch. No review. ........
r24644 | extempore | 2011-03-31 06:59:35 +0200 (Thu, 31 Mar 2011) | 2
lines
Making the scaladoc command line help look as pretty as all the
others ones do now. No review. ........ r24645 | extempore | 2011-03-31
07:58:01 +0200 (Thu, 31 Mar 2011) | 2 lines
Some minor sensibility improvements to previous patch, and tearing out
some obsolete pieces of scalap. No review. ........ r24646 | extempore |
2011-03-31 08:09:14 +0200 (Thu, 31 Mar 2011) | 2 lines
Fix for interpreter issue with missing newlines wreaking havoc. No
review. ........ r24648 | kzys | 2011-03-31 14:59:56 +0200 (Thu, 31 Mar
2011) | 2 lines
[scaladoc] Don't link to syntetic companion. Closes #4325. Review by
dubochet. ........ r24651 | dragos | 2011-03-31 16:36:38 +0200 (Thu, 31
Mar 2011) | 1 line
One breakage too many, this test is a pest -> disabled. no review.
........ r24652 | dragos | 2011-03-31 16:39:19 +0200 (Thu, 31 Mar 2011)
| 1 line
Fixed failing presentation compiler test. no review. ........ r24653 |
extempore | 2011-03-31 18:41:51 +0200 (Thu, 31 Mar 2011) | 1 line
Emptiness check in swing, closes #1578 no review. ........ r24654 |
extempore | 2011-03-31 18:42:05 +0200 (Thu, 31 Mar 2011) | 4 lines
Added some null checks in swing. I assumed the behavior when the input
verifier is null should be "assume it verifies" not "assume it doesn't"
but since I don't actually know anything about swing this guess could
be wrong. Closes #3783, review by imaier. ........ r24655 | odersky |
2011-03-31 18:46:48 +0200 (Thu, 31 Mar 2011) | 1 line
recommitted 24578: All compiler control methods now do something
sensible when called from presentation compiler thread itself. ........
r24656 | extempore | 2011-03-31 21:26:24 +0200 (Thu, 31 Mar 2011) | 3
lines
Printing refinement types in scaladoc. Actually only printing
one-member refinements, for bigger ones printing the number of members.
Should be improved. Closes #484, no review. ........ r24657 | extempore
| 2011-03-31 21:26:37 +0200 (Thu, 31 Mar 2011) | 3 lines
Fix for a little breakage which crept into power mode. This is
why real things with real types are better than generating code and
remembering to update your strings. No review. ........ r24658 |
extempore | 2011-03-31 22:44:29 +0200 (Thu, 31 Mar 2011) | 7 lines
Separated abstract and concrete value members in scaladoc. This looks
like such a runaway improvement to me that I'm just checking it
in, but if anyone feels differently say the word. I eliminated the
abstract/concrete filter entirely as it is extraneous once you can
just see which is which.
Closes #3831, review by malayeri.
........
r24659 | extempore | 2011-04-01 00:18:43 +0200 (Fri, 01 Apr 2011) | 2 lines
A quick fix for the weird string output one gets in the repl when
calling .par. No review. ........ r24660 | extempore | 2011-04-01
04:18:53 +0200 (Fri, 01 Apr 2011) | 5 lines
Working on the documentation of core classes. Trying to withdraw some
of the goodness I banked a while ago with the AnyVal types. Started on
what will culminate in the total elimination of SourcelessComments.
Cleaned up the docs on ancient classes like Product. More to come. No
review. ........ r24661 | extempore | 2011-04-01 07:02:30 +0200 (Fri, 01
Apr 2011) | 2 lines
A less ad hoc infrastructure for generating AnyVal sources. A few
more comments on said sources. No review. ........ r24662 | extempore |
2011-04-01 08:41:46 +0200 (Fri, 01 Apr 2011) | 1 line
Fix for parsing bug in scaladoc closes #4420, no review. ........
r24663 | extempore | 2011-04-01 18:00:50 +0200 (Fri, 01 Apr 2011) | 3
lines
Since somewhere before 2.8.0 shipped scalac has disgorged a stack
trace for the misdemeanor of specifying a non-existent directory for -d.
No more, no review. ........ r24664 | kzys | 2011-04-01 19:09:59 +0200
(Fri, 01 Apr 2011) | 2 lines
Put "\n" between superclass's comment and subclass's. Closes #4289.
Review by pedrofurla. ........ r24665 | extempore | 2011-04-01 19:18:34
+0200 (Fri, 01 Apr 2011) | 14 lines
Finding myself wanting a working -Ystop, I did the following.
-Ystop-after:phase works
-Ystop-before:phase works
-Ystop:phase is a backward compat alias for -Ystop-after
Until now -Ystop, although documented to "stop after phase", actually
stopped before phase, to the consternation of some. Furthermore the
programmatic way to influence the stop phase (protected def stopPhase in
Global#Run) involved returning true if you wanted to stop before the
phase. So now the command line option works as advertised, and the
method has the same semantics. The only potential loser is some script
which uses -Ystop: based on the actual behavior rather than the documented
behavior. Well, someone had to lose. No review.
........
r24666 | kzys | 2011-04-01 20:57:36 +0200 (Fri, 01 Apr 2011) | 2 lines
On Scaladoc, we should escape meta characters before compile regexp.
No review. ........ r24667 | extempore | 2011-04-02 01:55:01 +0200 (Sat,
02 Apr 2011) | 2 lines
A double completion whammy: crasher for edge condition and method
signatures not being cleaned of their $iws. Closes #4434, no review.
........ r24672 | malayeri | 2011-04-04 15:57:56 +0200 (Mon, 04 Apr
2011) | 1 line
[scaladoc] Add explicit link to show linear supertypes and known
subclasses. Closes #4416. Modifications to style sheets to reduce
number of colors and make the documentation more readable (includes
contributions from Ruediger Keller). No review. ........ r24673 |
malayeri | 2011-04-04 16:34:29 +0200 (Mon, 04 Apr 2011) | 1 line
[scaladoc] Add missing files.
........
r24674 | cunei | 2011-04-04 16:52:55 +0200 (Mon, 04 Apr 2011) | 2 lines
Fix for windows batch files. Closes #4439.
........
r24675 | malayeri | 2011-04-04 17:22:09 +0200 (Mon, 04 Apr 2011) | 1 line
[scaladoc] Minor CSS tweaks. No review.
........
r24676 | kzys | 2011-04-04 18:19:32 +0200 (Mon, 04 Apr 2011) | 2 lines
Every tag element (even @define and @usecase) end before the next
recognised tag. Closes #4409. Review by extempore. ........ r24677 |
odersky | 2011-04-04 18:34:02 +0200 (Mon, 04 Apr 2011) | 1 line
Fixed crashes in IDE on default parameters in constructors. ........
r24678 | malayeri | 2011-04-04 18:36:27 +0200 (Mon, 04 Apr 2011) | 1
line
[scaladoc] Change div id's of abstract and concrete members so that
"order by inheritance" action works properly. Fixes issue introduced in
r24658. Review by extempore. ........ r24679 | malayeri | 2011-04-04
18:37:51 +0200 (Mon, 04 Apr 2011) | 1 line
[scaladoc] Make object/template name be a link to the companion.
Closes #4411. Review by extempore to make sure the design makes sense.
........ r24680 | malayeri | 2011-04-04 18:38:11 +0200 (Mon, 04 Apr
2011) | 1 line
[scaladoc] Fix minor CSS issue. No review.
........
r24681 | odersky | 2011-04-04 19:35:19 +0200 (Mon, 04 Apr 2011) | 1 line
Some localized code cleanup.
........
r24682 | malayeri | 2011-04-04 20:17:26 +0200 (Mon, 04 Apr 2011) | 1 line
[scaladoc] Updated trait, package, class, and object icons. No review.
........ r24683 | extempore | 2011-04-05 03:48:11 +0200 (Tue, 05 Apr
2011) | 12 lines
Added a long overdue warning for when people define a class and then
an object or vice versa in the repl.
scala> object Bippy { implicit val myImplicitsDontWork = 5 }
defined module Bippy
scala> trait Bippy { val x = "hello" }
defined trait Bippy
warning: previously defined object Bippy is not a companion to trait Bippy.
Companions must be defined together; you may wish to use :paste mode for this.
No review.
........
r24684 | extempore | 2011-04-05 03:48:31 +0200 (Tue, 05 Apr 2011) | 6 lines
Enhancing the repl-testing code by turning it into a transcript
producing machine. "Here's some code." "Here's a transcript!" "Good
day to you, sir!" "No, good day to YOU!"
These changes are awesome. Look at the checkfile diffs for god's sake,
they'll make you weep with joy. No review. ........ r24685 | rytz |
2011-04-05 09:50:41 +0200 (Tue, 05 Apr 2011) | 1 line
make natives test run on win64. no review
........
r24686 | rytz | 2011-04-05 09:54:41 +0200 (Tue, 05 Apr 2011) | 1 line
svn property: mark the dll as binary. no review.
........
r24687 | malayeri | 2011-04-05 10:36:32 +0200 (Tue, 05 Apr 2011) | 1 line
[scaladoc] Fix failing test. No review.
........
r24688 | odersky | 2011-04-05 14:19:10 +0200 (Tue, 05 Apr 2011) | 1 line
Fixes #4298, by correcting doc comment
........
r24689 | dragos | 2011-04-05 18:19:45 +0200 (Tue, 05 Apr 2011) | 3 lines
Wrapped exceptions coming from calls to 'ask' in a FailedException.
This allows to get a stack trace from both the presentation compiler
thread and the calling thread. review by odersky. ........ r24690 |
odersky | 2011-04-05 18:22:21 +0200 (Tue, 05 Apr 2011) | 1 line
better handling of on-same-thread calls.
........
r24691 | dragos | 2011-04-05 19:03:51 +0200 (Tue, 05 Apr 2011) | 1 line
Forgot a import in the last commit. no review.
........
r24692 | extempore | 2011-04-06 01:19:26 +0200 (Wed, 06 Apr 2011) | 3 lines
Some accumulated cleanups around the interpreter loop commands as I
attempt to make my way all the way to the promised land of documenting
it. No review. ........ r24693 | extempore | 2011-04-06 06:33:15 +0200
(Wed, 06 Apr 2011) | 1 line
Fixed an edge case setting crasher, no review.
........
r24694 | extempore | 2011-04-06 06:33:27 +0200 (Wed, 06 Apr 2011) | 3 lines
Fixed a failure output regression I introduced working around a
process bug. Unrolled the code I'd put in to work around the now-fixed
process bug. No review. ........ r24695 | extempore | 2011-04-06
06:33:46 +0200 (Wed, 06 Apr 2011) | 1 line
Misc cleanups and crash avoidance, no review.
........
r24696 | malayeri | 2011-04-06 16:23:25 +0200 (Wed, 06 Apr 2011) | 1 line
Set "synthetic" flag for methods $asInstanceOf and $isInstanceOf.
Closes #4368. No review. ........ r24697 | malayeri | 2011-04-06
16:24:30 +0200 (Wed, 06 Apr 2011) | 1 line
[scaladoc] Reduce horizontal lines in html output, refactor
Template.css to improve readability. No review. ........ r24698 |
malayeri | 2011-04-06 16:28:41 +0200 (Wed, 06 Apr 2011) | 1 line
Update documentation of MutableList. Closes #4397. No review. ........
r24699 | odersky | 2011-04-06 16:32:32 +0200 (Wed, 06 Apr 2011) | 1 line
More refinements to avoid deadlocks systematically when asking from
presentation compiler thread ........ r24700 | extempore | 2011-04-06
20:48:15 +0200 (Wed, 06 Apr 2011) | 3 lines
The beautification of repl pasting had the problem that the new
beautiful output was not itself pastable. Now I have achieved "paste
idempotence". No review. ........ r24701 | extempore | 2011-04-07
09:30:38 +0200 (Thu, 07 Apr 2011) | 2 lines
Clamping down on some more breakage which snuck into power mode. I
really need some power tests. No review. ........ r24702 | extempore |
2011-04-07 09:31:02 +0200 (Thu, 07 Apr 2011) | 9 lines
Deleted SourcelessComments. Created source files for Any, AnyRef,
Nothing and Null with improved documentation of their particulars
and convinced scaladoc to parse them without leaving scalac
institutionalized. Now rather than seeing our hardcoded documentation
strings bitrot in a shadowy flight from classes which do not exist, we
are championing the cause of the innocent and powerless. Nothing and
Null aren't above the law!
So now any responsible party can fire up their text editor and go
to town on Nothing.scala. As I'm sure they will. Review by malayeri.
........ r24703 | extempore | 2011-04-07 09:31:14 +0200 (Thu, 07 Apr
2011) | 2 lines
Added a comment to Dynamic sharing that if you don't supply mr.
-Xexperimental, it won't work. No review. ........ r24704 | malayeri |
2011-04-07 15:34:14 +0200 (Thu, 07 Apr 2011) | 1 line
[scaladoc] Make links to classes and traits not be the entire line,
but just the template name. Closes #4444. No review. ........ r24705 |
malayeri | 2011-04-07 16:03:49 +0200 (Thu, 07 Apr 2011) | 1 line
[scaladoc] Don't generate an attributes block if its contents are
empty. No review. ........ r24706 | odersky | 2011-04-07 16:30:56 +0200
(Thu, 07 Apr 2011) | 1 line
Fixes #2808 without redefining what override means. Review by
extempore. ........ r24708 | extempore | 2011-04-07 19:43:41 +0200 (Thu,
07 Apr 2011) | 10 lines
Made power mode more configurable. Don't think of this as the
long-term configuration answer, but what I have any chance of doing
before 2.9 ships.
// file to interpret when entering power mode instead of default
-Dscala.repl.power.initcode=/path/to/file // file holding banner to
display instead of default -Dscala.repl.power.banner=/path/to/file
No review.
........
r24709 | magarcia | 2011-04-08 13:38:48 +0200 (Fri, 08 Apr 2011) | 1 line
[MSIL] handling of volatile fields. review by rytz. ........ r24710 |
malayeri | 2011-04-08 16:26:22 +0200 (Fri, 08 Apr 2011) | 1 line
[scaladoc] Separate sections for "linear supertype" and "known
subclasses" using patch provided by Ruediger Keller. Closes #4456.
Closes #4304. ........ r24711 | malayeri | 2011-04-08 17:10:32 +0200
(Fri, 08 Apr 2011) | 1 line
[scaladoc] Don't generate long comments if they are the same as the
short comment. Closes #4455. No review. ........ r24712 | odersky |
2011-04-08 18:31:26 +0200 (Fri, 08 Apr 2011) | 1 line
Closes #4431. Review by extempore.
........
r24713 | extempore | 2011-04-08 18:42:18 +0200 (Fri, 08 Apr 2011) | 2 lines
Factoring the imports related code out of the main Interpreter class,
no review. ........ r24714 | extempore | 2011-04-08 18:42:38 +0200 (Fri,
08 Apr 2011) | 1 line
Added :imports command, no review.
........
r24715 | extempore | 2011-04-10 04:17:28 +0200 (Sun, 10 Apr 2011) | 1 line
Made the reading of y/n a little more robust. No review. ........
r24716 | extempore | 2011-04-10 04:18:08 +0200 (Sun, 10 Apr 2011) | 2
lines
More fun with xml and elements not appearing equal. Closes #4387, no
review. ........ r24717 | extempore | 2011-04-10 04:18:32 +0200 (Sun, 10
Apr 2011) | 2 lines
Changed scala.io.Position into something other than a fixed object
which throws exceptions when the position overflows. Closes #4382, no
review. ........ r24719 | extempore | 2011-04-11 05:04:47 +0200 (Mon, 11
Apr 2011) | 2 lines
Improving the repl help infrastructure, and made the :wrap command
more robust. No review. ........ r24720 | extempore | 2011-04-11
07:01:17 +0200 (Mon, 11 Apr 2011) | 4 lines
Found there was still all kinds of detritus remaining from the
deceased IMPLICITMETHODtpe and ImplicitMethodType. Applied wrecking
ball, review by moors. (Can I do the same thing with DEBRUIJNINDEXtpe
and DeBruijnIndex?) ........ r24721 | eugenevigdorchik | 2011-04-11
08:42:47 +0200 (Mon, 11 Apr 2011) | 1 line
Tighten the visibility of interactive.Global. No review. ........
r24722 | odersky | 2011-04-11 09:01:55 +0200 (Mon, 11 Apr 2011) | 1 line
Closes #4396. No review.
........
r24723 | odersky | 2011-04-11 10:53:51 +0200 (Mon, 11 Apr 2011) | 1 line
Closes #4380. No review.
........
r24724 | odersky | 2011-04-11 10:56:57 +0200 (Mon, 11 Apr 2011) | 1 line
Deleted debug output that made it into previous commit. ........
Diffstat (limited to 'test/files')
45 files changed, 698 insertions, 681 deletions
diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check index 3c0ee7b4bd..dd0f39551c 100644 --- a/test/files/jvm/interpreter.check +++ b/test/files/jvm/interpreter.check @@ -2,222 +2,360 @@ Type in expressions to have them evaluated. Type :help for more information. scala> -scala> -scala> res0: Int = 7 -scala> | | | | gcd: (x: Int,y: Int)Int +scala> // basics + +scala> 3+4 +res0: Int = 7 -scala> five: Int = 5 +scala> def gcd(x: Int, y: Int): Int = { + if (x == 0) y + else if (y == 0) x + else gcd(y%x, x) +} +gcd: (x: Int,y: Int)Int -scala> x: Int = 1 +scala> val five = gcd(15,35) +five: Int = 5 -scala> x: Int = 2 +scala> var x = 1 +x: Int = 1 -scala> three: Int = 3 +scala> x = 2 +x: Int = 2 -scala> defined type alias anotherint +scala> val three = x+1 +three: Int = 3 -scala> four: anotherint = 4 +scala> type anotherint = Int +defined type alias anotherint -scala> <console>:8: error: type mismatch; +scala> val four: anotherint = 4 +four: anotherint = 4 + +scala> val bogus: anotherint = "hello" +<console>:8: error: type mismatch; found : java.lang.String("hello") required: anotherint val bogus: anotherint = "hello" ^ -scala> defined trait PointlessTrait +scala> trait PointlessTrait +defined trait PointlessTrait -scala> x: Int = 2 +scala> val (x,y) = (2,3) +x: Int = 2 y: Int = 3 -scala> hello +scala> println("hello") +hello scala> -scala> -scala> t1513: Array[Null] = Array(null) -scala> -scala> atom: scala.xml.Atom[Unit] = () +scala> // ticket #1513 -scala> -scala> defined class S +scala> val t1513 = Array(null) +t1513: Array[Null] = Array(null) -scala> fish: S = fish +scala> // ambiguous toString problem from #547 -scala> -scala> arr: Array[java.lang.String] = Array(What's, up, doc?) +scala> val atom = new scala.xml.Atom() +atom: scala.xml.Atom[Unit] = () -scala> -scala> arrInt: Any = Array(1, 2, 3) +scala> // overriding toString problem from #1404 -scala> -scala> arrArrInt: Any = Array(Array(1, 2), Array(3, 4)) +scala> class S(override val toString : String) +defined class S -scala> -scala> -scala> defined class Foo +scala> val fish = new S("fish") +fish: S = fish -scala> defined class Bar +scala> // Test that arrays pretty print nicely. -scala> foo2bar: (foo: Foo)Bar +scala> val arr = Array("What's", "up", "doc?") +arr: Array[java.lang.String] = Array(What's, up, doc?) -scala> bar: Bar = Bar(3) +scala> // Test that arrays pretty print nicely, even when we give them type Any + +scala> val arrInt : Any = Array(1,2,3) +arrInt: Any = Array(1, 2, 3) + +scala> // Test that nested arrays are pretty-printed correctly + +scala> val arrArrInt : Any = Array(Array(1, 2), Array(3, 4)) +arrArrInt: Any = Array(Array(1, 2), Array(3, 4)) scala> + +scala> // implicit conversions + +scala> case class Foo(n: Int) +defined class Foo + +scala> case class Bar(n: Int) +defined class Bar + +scala> implicit def foo2bar(foo: Foo) = Bar(foo.n) +foo2bar: (foo: Foo)Bar + +scala> val bar: Bar = Foo(3) +bar: Bar = Bar(3) + scala> + +scala> // importing from a previous result + scala> import bar._ +import bar._ -scala> m: Int = 3 +scala> val m = n +m: Int = 3 scala> -scala> -scala> one: Int = 1 -scala> one: Int = 1 +scala> // stressing the imports mechanism -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 -scala> one: Int = 1 +scala> val one = 1 +one: Int = 1 + +scala> val one = 1 +one: Int = 1 + +scala> val one = 1 +one: Int = 1 scala> + scala> -scala> x1: Int = 1 -scala> x2: Int = 1 +scala> val x1 = 1 +x1: Int = 1 -scala> x3: Int = 1 +scala> val x2 = 1 +x2: Int = 1 -scala> x4: Int = 1 +scala> val x3 = 1 +x3: Int = 1 -scala> x5: Int = 1 +scala> val x4 = 1 +x4: Int = 1 -scala> x6: Int = 1 +scala> val x5 = 1 +x5: Int = 1 -scala> x7: Int = 1 +scala> val x6 = 1 +x6: Int = 1 -scala> x8: Int = 1 +scala> val x7 = 1 +x7: Int = 1 -scala> x9: Int = 1 +scala> val x8 = 1 +x8: Int = 1 -scala> x10: Int = 1 +scala> val x9 = 1 +x9: Int = 1 -scala> x11: Int = 1 +scala> val x10 = 1 +x10: Int = 1 -scala> x12: Int = 1 +scala> val x11 = 1 +x11: Int = 1 -scala> x13: Int = 1 +scala> val x12 = 1 +x12: Int = 1 -scala> x14: Int = 1 +scala> val x13 = 1 +x13: Int = 1 -scala> x15: Int = 1 +scala> val x14 = 1 +x14: Int = 1 -scala> x16: Int = 1 +scala> val x15 = 1 +x15: Int = 1 -scala> x17: Int = 1 +scala> val x16 = 1 +x16: Int = 1 -scala> x18: Int = 1 +scala> val x17 = 1 +x17: Int = 1 -scala> x19: Int = 1 +scala> val x18 = 1 +x18: Int = 1 -scala> x20: Int = 1 +scala> val x19 = 1 +x19: Int = 1 -scala> -scala> two: Int = 2 +scala> val x20 = 1 +x20: Int = 1 scala> + +scala> val two = one + x5 +two: Int = 2 + scala> -scala> -scala> xs: Array[_] = Array(1, 2) -scala> res2: Int = 2 +scala> // handling generic wildcard arrays (#2386) -scala> res3: Any = 1 +scala> // It's put here because type feedback is an important part of it. -scala> res4: Array[_] = Array(2) +scala> val xs: Array[_] = Array(1, 2) +xs: Array[_] = Array(1, 2) -scala> res5: Array[java.lang.String] = Array(abc, abc) +scala> xs.size +res2: Int = 2 -scala> res6: scala.collection.mutable.ArraySeq[_] = ArraySeq(1, 2) +scala> xs.head +res3: Any = 1 -scala> res7: Array[(_$1, _$1)] forSome { type _$1 } = Array((1,1), (2,2)) +scala> xs filter (_ == 2) +res4: Array[_] = Array(2) + +scala> xs map (_ => "abc") +res5: Array[java.lang.String] = Array(abc, abc) + +scala> xs map (x => x) +res6: scala.collection.mutable.ArraySeq[_] = ArraySeq(1, 2) + +scala> xs map (x => (x, x)) +res7: Array[(_$1, _$1)] forSome { type _$1 } = Array((1,1), (2,2)) scala> -scala> -scala> -scala> <console>:1: error: '=' expected but '=>' found. + +scala> // interior syntax errors should *not* go into multi-line input mode. + +scala> // both of the following should abort immediately: + +scala> def x => y => z +<console>:1: error: '=' expected but '=>' found. def x => y => z ^ -scala> <console>:1: error: illegal start of definition +scala> [1,2,3] +<console>:1: error: illegal start of definition [1,2,3] ^ scala> + scala> -scala> -scala> | | | | res8: scala.xml.Elem = + +scala> // multi-line XML + +scala> <a> +<b + c="c" + d="dd" +/></a> +res8: scala.xml.Elem = <a> <b c="c" d="dd"></b></a> scala> + scala> -scala> | | | | -scala> + +scala> /* + /* + multi-line comment + */ +*/ + scala> + scala> -scala> | | | res9: java.lang.String = + +scala> // multi-line string + +scala> """ +hello +there +""" +res9: java.lang.String = " hello there " scala> -scala> | | You typed two blank lines. Starting a new command. -scala> -scala> match: Int +scala> (1 + // give up early by typing two blank lines -scala> x: Int = 1 + +You typed two blank lines. Starting a new command. + +scala> // defining and using quoted names should work (ticket #323) + +scala> def `match` = 1 +match: Int + +scala> val x = `match` +x: Int = 1 scala> -scala> -scala> defined class Exp + +scala> // multiple classes defined on one line + +scala> sealed class Exp; class Fact extends Exp; class Term extends Exp +defined class Exp defined class Fact defined class Term -scala> | | <console>:18: warning: match is not exhaustive! +scala> def f(e: Exp) = e match { // non-exhaustive warning here + case _:Fact => 3 +} +<console>:18: warning: match is not exhaustive! missing combination Exp missing combination Term @@ -226,6 +364,7 @@ missing combination Term f: (e: Exp)Int scala> + scala> plusOne: (x: Int)Int res0: Int = 6 diff --git a/test/files/jvm/mkLibNatives.bat b/test/files/jvm/mkLibNatives.bat index 100246af79..e11b6ee21c 100755 --- a/test/files/jvm/mkLibNatives.bat +++ b/test/files/jvm/mkLibNatives.bat @@ -4,6 +4,9 @@ rem ########################################################################## rem # Author : Stephane Micheloud
rem ##########################################################################
+rem # For building the -64.dll, you need: Visual C++ Express, Microsoft SDK (to
+rem # get the 64bit compiler / libraries), adapt this script.
+
rem ##########################################################################
rem # variables
diff --git a/test/files/jvm/natives-64.dll b/test/files/jvm/natives-64.dll Binary files differnew file mode 100644 index 0000000000..f892f088f5 --- /dev/null +++ b/test/files/jvm/natives-64.dll diff --git a/test/files/neg/annot-nonconst.check b/test/files/neg/annot-nonconst.check index 385f066baa..e4166e08b6 100644 --- a/test/files/neg/annot-nonconst.check +++ b/test/files/neg/annot-nonconst.check @@ -11,7 +11,7 @@ class Ann2(value: String) extends ClassfileAnnotation annot-nonconst.scala:6: error: annotation argument needs to be a constant; found: n @Length(n) def foo = "foo" ^ -annot-nonconst.scala:7: error: annotation argument needs to be a constant; found: null +annot-nonconst.scala:7: error: annotation argument cannot be null @Ann2(null) def bar = "bar" ^ two warnings found diff --git a/test/files/neg/bug3736.check b/test/files/neg/bug3736.check index 8a91088914..cc222d1221 100644 --- a/test/files/neg/bug3736.check +++ b/test/files/neg/bug3736.check @@ -1,6 +1,9 @@ bug3736.scala:4: error: super not allowed here: use this.isInstanceOf instead def f2 = super.isInstanceOf[String] ^ +bug3736.scala:5: error: super not allowed here: use this.asInstanceOf instead + def f3 = super.asInstanceOf[AnyRef] + ^ bug3736.scala:6: error: super not allowed here: use this.== instead def f4 = super.==(new AnyRef) ^ @@ -10,4 +13,4 @@ bug3736.scala:7: error: super not allowed here: use this.!= instead bug3736.scala:8: error: super not allowed here: use this.## instead def f6 = super.## ^ -four errors found +5 errors found diff --git a/test/files/neg/super-cast-or-test.check b/test/files/neg/super-cast-or-test.check new file mode 100644 index 0000000000..8e5eed62bd --- /dev/null +++ b/test/files/neg/super-cast-or-test.check @@ -0,0 +1,7 @@ +super-cast-or-test.scala:1: error: super not allowed here: use this.asInstanceOf instead +trait A { def f = super.asInstanceOf[AnyRef] } + ^ +super-cast-or-test.scala:2: error: super not allowed here: use this.isInstanceOf instead +trait B { def g = super.isInstanceOf[AnyRef] } + ^ +two errors found diff --git a/test/files/neg/super-cast-or-test.scala b/test/files/neg/super-cast-or-test.scala new file mode 100644 index 0000000000..a0f86d8081 --- /dev/null +++ b/test/files/neg/super-cast-or-test.scala @@ -0,0 +1,3 @@ +trait A { def f = super.asInstanceOf[AnyRef] } +trait B { def g = super.isInstanceOf[AnyRef] } + diff --git a/test/files/neg/t3399.check b/test/files/neg/t3399.check index eb6c679704..987da944c6 100644 --- a/test/files/neg/t3399.check +++ b/test/files/neg/t3399.check @@ -1,4 +1,4 @@ -t3399.scala:23: error: could not find implicit value for parameter e: =:=[Nats.Add[Nats._1,Nats._1],Nats._1] +t3399.scala:23: error: Cannot prove that Nats.Add[Nats._1,Nats._1] =:= Nats._1. implicitly[ Add[_1, _1] =:= _1] ^ one error found diff --git a/test/files/neg/t3507.check b/test/files/neg/t3507.check index 1246a20d09..ab38280c1f 100644 --- a/test/files/neg/t3507.check +++ b/test/files/neg/t3507.check @@ -1,4 +1,4 @@ -t3507.scala:13: error: could not find implicit value for evidence parameter of type Manifest[object _1.b.c] +t3507.scala:13: error: No Manifest available for object _1.b.c. mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier ^ one error found diff --git a/test/files/neg/t4431.check b/test/files/neg/t4431.check new file mode 100644 index 0000000000..7896ec1a62 --- /dev/null +++ b/test/files/neg/t4431.check @@ -0,0 +1,7 @@ +t4431.scala:5: error: class BB needs to be abstract, since there is a deferred declaration of method f which is not implemented in a subclass + class BB extends B { def f (): Unit } + ^ +t4431.scala:8: error: trait cannot redefine final method from class AnyRef + trait C { def wait (): Unit } + ^ +two errors found diff --git a/test/files/neg/t4431.scala b/test/files/neg/t4431.scala new file mode 100644 index 0000000000..5fbb239e04 --- /dev/null +++ b/test/files/neg/t4431.scala @@ -0,0 +1,16 @@ +object Test { + // this works. + class B { final def f(): Unit = () } + trait A extends B { def f (): Unit } + class BB extends B { def f (): Unit } + + // this earns a VerifyError. + trait C { def wait (): Unit } + class D { } + + def main(args: Array[String]): Unit = { + new B with A { } + new BB +// new D with C { } + } +} diff --git a/test/files/pos/javaReadsSigs/fromjava.java b/test/files/pos/javaReadsSigs/fromjava.java index d31244bb95..745fb84efd 100644 --- a/test/files/pos/javaReadsSigs/fromjava.java +++ b/test/files/pos/javaReadsSigs/fromjava.java @@ -1,16 +1,75 @@ +import scala.*; +import scala.math.Ordering; +import scala.math.Numeric; +import scala.collection.Seq; +import scala.collection.Traversable; +import scala.collection.Traversable$; +import scala.collection.immutable.Set; +import scala.collection.immutable.HashSet; +import scala.collection.immutable.Map; +import scala.collection.immutable.Map$; +import scala.collection.immutable.HashMap; import scala.collection.immutable.Vector; import scala.collection.immutable.List; +import scala.collection.generic.CanBuildFrom; -public class fromjava { +class A { }; +class B { }; + +// This one compiles but it would be better if it didn't. +// Checking in under pos anyway in the interests of making sure +// we are informed if the status changes. +class Contra { + // Not an Ordering<Character>. + static Ordering<Object> charOrd = scala.math.Ordering$Char$.MODULE$; + + public boolean useCharOrd() { + return charOrd.compare(new Object(), new Object()) == 0; + } + + static Numeric<?> intNum = scala.math.Numeric$IntIsIntegral$.MODULE$; +} - void main(String[] args, Vector<String> x) { - Vector<String> y = x.take(2); - String h = y.head(); - System.out.println(h); +public class fromjava { + public static Function1<A, B> f1 = new scala.runtime.AbstractFunction1<A, B>() { + public B apply(A a) { + return null; } - void main(String[] args, List<String> x) { - List<String> y = x.drop(2); - String h = y.head(); - System.out.println(h); + }; + + public static Function1<Tuple2<? extends Object, B>, B> f2 = new scala.runtime.AbstractFunction1<Tuple2<? extends Object, B>, B>() { + public B apply(Tuple2<? extends Object, B> tup) { + return tup._2(); } + }; + + public static String vector(Vector<String> x) { + Vector<String> y = x.take(2); + return y.head(); + } + public static String list(List<String> x) { + List<String> y = x.drop(2); + return y.head(); + } + public static Tuple2<String, Integer> map(Map<String, Integer> x) { + Traversable<Tuple2<String, Integer>> y = x.drop(2); + return y.head(); + } + public static <T> Object sum(Traversable<T> x) { + return x.sum(Contra.intNum); + } + // Looks like sum as given below fails under java5, so disabled. + // + // [partest] testing: [...]/files/pos/javaReadsSigs [FAILED] + // [partest] files/pos/javaReadsSigs/fromjava.java:62: name clash: sum(scala.collection.Traversable<A>) and <T>sum(scala.collection.Traversable<T>) have the same erasure + // [partest] public static B sum(Traversable<A> x) { + // [partest] ^ + // + // + // can't make this work with an actual CanBuildFrom: see #4389. + // public static B sum(Traversable<A> x) { + // // have to cast it unfortunately: map in TraversableLike returns + // // "That" and such types seem to be signature poison. + // return ((Traversable<B>)x.map(f1, null)).head(); + // } }
\ No newline at end of file diff --git a/test/files/presentation/find-trees.check b/test/files/presentation/find-trees.check index 33213dd911..9f60d4fb52 100644 --- a/test/files/presentation/find-trees.check +++ b/test/files/presentation/find-trees.check @@ -3,4 +3,4 @@ asking position at 19:4 retrieved tree: InteractiveTest.this.settings ==================== asking position at 20:16 -retrieved tree: lazy private[this] var compiler: scala.tools.nsc.interactive.CompilerControl = new Global(InteractiveTest.this.settings, InteractiveTest.this.reporter) +retrieved tree: lazy private[this] var compiler: scala.tools.nsc.interactive.CompilerControl = new Global(InteractiveTest.this.settings, InteractiveTest.this.reporter, interactive.this.Global.init$default$3) diff --git a/test/files/presentation/simple-tests/SimpleInteractiveTest.scala b/test/files/presentation/simple-tests/SimpleInteractiveTest.scala deleted file mode 100644 index 014fd24b6f..0000000000 --- a/test/files/presentation/simple-tests/SimpleInteractiveTest.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.tools.nsc.interactive.tests._ - -/** Simple test that shows how to use the InteractiveTest class. It uses the - * inherited runTest method that runs completion and typedAt tests on all - * sources found under src/ - */ -object Test extends InteractiveTest { - override val runRandomTests = false -// settings.YpresentationDebug.value = true -// override val synchronousRequests = false -} diff --git a/test/files/presentation/simple-tests/src/Tester.scala b/test/files/presentation/simple-tests/src/Tester.scala deleted file mode 100644 index cb62187514..0000000000 --- a/test/files/presentation/simple-tests/src/Tester.scala +++ /dev/null @@ -1,204 +0,0 @@ -package scala.tools.nsc -package interactive -package tests - -import util._ -import reporters._ -import io.AbstractFile -import collection.mutable.ArrayBuffer - -class Tester(ntests: Int, inputs: Array[SourceFile], settings: Settings) { - - val reporter = new StoreReporter - val compiler = new Global(settings, reporter) - - def askAndListen[T, U](msg: String, arg: T, op: (T, Response[U]) => Unit) { - if (settings.verbose./*!*/value) print(msg+" "+arg+": ") - val TIMEOUT = 10 // ms - val limit/*?*/ = System.currentTimeMillis() + randomDelayMillis - val res/*?*/ = new Response[U] - op(arg, res) - while (!res.isComplete && !res.isCancelled) { - if (System.currentTimeMillis() > limit) { - print("c"); res./*!*/cancel() - } else res.get(TIMEOUT) match { - case Some(Left(t)) => - /**/ - if (settings./*!*/verbose.value) println(t) - case Some(Right(ex)) => - ex.printStackTrace() - println(ex) - case None => - } - } - } - - def askReload(sfs: SourceFile*) = askAndListen("reload", sfs.toList, compiler.askReload) - def askTypeAt(pos: Position) = askAndListen("type at", pos, compiler.askTypeAt) - def askTypeCompletion(pos: Position) = askAndListen("type at", pos, compiler.askTypeCompletion) - def askScopeCompletion(pos: Position) = askAndListen("type at", pos, compiler.askScopeCompletion) - - val rand = new java.util.Random() - - private def randomInverse(n: Int) = n / (rand.nextInt(n) + 1) - - private def randomDecreasing(n: Int) = { - var r = rand.nextInt((1 to n).sum) - var limit = n - var result = 0 - while (r > limit) { - result += 1 - r -= limit - limit -= 1 - } - result - } - - def randomSourceFileIdx() = rand.nextInt(inputs.length) - - def randomBatchesPerSourceFile(): Int = randomDecreasing(100) - - def randomChangesPerBatch(): Int = randomInverse(50) - - def randomPositionIn(sf: SourceFile) = rand.nextInt(sf.content.length) - - def randomNumChars() = randomInverse(100) - - def randomDelayMillis = randomInverse(10000) - - class Change(sfidx: Int, start: Int, nchars: Int, toLeft: Boolean) { - - private var pos = start - private var deleted: List[Char] = List() - - override def toString = - "In "+inputs(sfidx)+" at "+start+" take "+nchars+" to "+ - (if (toLeft) "left" else "right") - - def deleteOne() { - val sf = inputs(sfidx) - deleted = sf.content(pos) :: deleted - val sf1 = new BatchSourceFile(sf.file, sf.content.take(pos) ++ sf.content.drop(pos + 1)) - inputs(sfidx) = sf1 - askReload(sf1) - } - - def deleteAll() { - print("/"+nchars) - for (i <- 0 until nchars) { - if (toLeft) { - if (pos > 0 && pos <= inputs(sfidx).length) { - pos -= 1 - deleteOne() - } - } else { - if (pos < inputs(sfidx).length) { - deleteOne() - } - } - } - } - - def insertAll() { - for (chr <- if (toLeft) deleted else deleted.reverse) { - val sf = inputs(sfidx) - val (pre, post) = sf./*!*/content splitAt pos - pos += 1 - val sf1 = new BatchSourceFile(sf.file, pre ++ (chr +: post)) - inputs(sfidx) = sf1 - askReload(sf1) - } - } - } - - val testComment = "/**/" - - def testFileChanges(sfidx: Int) = { - lazy val testPositions: Seq[Int] = { - val sf = inputs(sfidx) - val buf = new ArrayBuffer[Int] - var pos = sf.content.indexOfSlice(testComment) - while (pos > 0) { - buf += pos - pos = sf.content.indexOfSlice(testComment, pos + 1) - } - buf - } - def otherTest() { - if (testPositions.nonEmpty) { - val pos = new OffsetPosition(inputs(sfidx), rand.nextInt(testPositions.length)) - rand.nextInt(3) match { - case 0 => askTypeAt(pos) - case 1 => askTypeCompletion(pos) - case 2 => askScopeCompletion(pos) - } - } - } - for (i <- 0 until randomBatchesPerSourceFile()) { - val changes = Vector.fill(/**/randomChangesPerBatch()) { - /**/ - new Change(sfidx, randomPositionIn(inputs(sfidx)), randomNumChars(), rand.nextBoolean()) - } - doTest(sfidx, changes, testPositions, otherTest) match { - case Some(errortrace) => - println(errortrace) - minimize(errortrace) - case None => - } - } - } - - def doTest(sfidx: Int, changes: Seq[Change], testPositions: Seq[Int], otherTest: () => Unit): Option[ErrorTrace] = { - print("new round with "+changes.length+" changes:") - changes foreach (_.deleteAll()) - otherTest() - def errorCount() = compiler.ask(() => reporter.ERROR.count) -// println("\nhalf test round: "+errorCount()) - changes.view.reverse foreach (_.insertAll()) - otherTest() - println("done test round: "+errorCount()) - if (errorCount() != 0) - Some(ErrorTrace(sfidx, changes, reporter.infos, inputs(sfidx).content)) - else - None - } - - case class ErrorTrace( - sfidx: Int, changes: Seq[Change], infos: collection.Set[reporter.Info], content: Array[Char]) { - override def toString = - "Sourcefile: "+inputs(sfidx)+ - "\nChanges:\n "+changes.mkString("\n ")+ - "\nErrors:\n "+infos.mkString("\n ")+ - "\nContents:\n"+content.mkString - } - - def minimize(etrace: ErrorTrace) {} - - /**/ - def run() { - askReload(inputs: _*) - for (i <- 0 until ntests) - testFileChanges(randomSourceFileIdx()) - } -} - -/* A program to do presentation compiler stress tests. - * Usage: - * - * scala scala.tools.nsc.interactive.test.Tester <n> <files> - * - * where <n> is the number os tests to be run and <files> is the set of files to test. - * This will do random deletions and re-insertions in any of the files. - * At places where an empty comment /**/ appears it will in addition randomly - * do ask-types, type-completions, or scope-completions. - */ -object Tester { - def main(args: Array[String]) { - val settings = new Settings() - val (_, filenames) = settings.processArguments(args.toList.tail, true) - println("filenames = "+filenames) - val files = filenames.toArray map (str => new BatchSourceFile(AbstractFile.getFile(str)): SourceFile) - new Tester(args(0).toInt, files, settings).run() - sys.exit(0) - } -} diff --git a/test/files/run/bug3376.check b/test/files/run/bug3376.check index 7286096022..3a1d7d581b 100644 --- a/test/files/run/bug3376.check +++ b/test/files/run/bug3376.check @@ -2,12 +2,17 @@ Type in expressions to have them evaluated. Type :help for more information. scala> -scala> defined class M -scala> m1: M[Int] = mmm +scala> class M[@specialized T] { override def toString = "mmm" } +defined class M -scala> m2: M[Float] = mmm +scala> val m1 = new M[Int]() +m1: M[Int] = mmm -scala> m3: M[String] = mmm +scala> val m2 = new M[Float]() +m2: M[Float] = mmm + +scala> val m3 = new M[String]() +m3: M[String] = mmm scala> diff --git a/test/files/run/bug4080.check b/test/files/run/bug4080.check new file mode 100644 index 0000000000..66ce31bb43 --- /dev/null +++ b/test/files/run/bug4080.check @@ -0,0 +1 @@ +LinkedList(1, 0, 2, 3) diff --git a/test/files/run/bug4080.scala b/test/files/run/bug4080.scala new file mode 100644 index 0000000000..92740ed776 --- /dev/null +++ b/test/files/run/bug4080.scala @@ -0,0 +1,12 @@ +import scala.collection.mutable.LinkedList + +object Test { + def main(args: Array[String]) { + val ll = LinkedList(1, 2, 3) + ll.insert(LinkedList(0)) + println(ll) + val ll2 = LinkedList[Int]() + try println(ll2.head) + catch { case _ => () } + } +} diff --git a/test/files/run/bug4279.scala b/test/files/run/bug4279.scala deleted file mode 100644 index 89a27fc065..0000000000 --- a/test/files/run/bug4279.scala +++ /dev/null @@ -1,38 +0,0 @@ -import scala.tools.partest._ - -// Attempting to verify slice isn't 100,000x slower -// with views than non-views. -class Runner(num: Int, reps: Int) extends TestUtil { - var dummy = 0 - val range = Array.range(0, num) - - def iteratorSlice = { - def it = range.iterator.slice(num - 2, num) - for (i <- 1 to reps) - it foreach (dummy = _) - } - def viewSlice = { - val view = range.view.slice(num - 2, num) - for (i <- 1 to reps) - view foreach (dummy = _) - } - def straightSlice = { - val xs = range.slice(num - 2, num) - for (i <- 1 to reps) - xs foreach (dummy = _) - } - def run(multiple: Double) = { - verifySpeed(straightSlice, iteratorSlice, multiple) - verifySpeed(straightSlice, viewSlice, multiple) - } -} - -object Test { - def main(args: Array[String]): Unit = { - // warmup - { val r = new Runner(1000000, 10) ; r.straightSlice ; r.iteratorSlice ; r.viewSlice } - - new Runner(10000000, 10) run 100 - new Runner(10000000, 50) run 50 - } -} diff --git a/test/files/run/bug4285.check b/test/files/run/bug4285.check index 5a3c9811c3..84f8929e43 100644 --- a/test/files/run/bug4285.check +++ b/test/files/run/bug4285.check @@ -2,11 +2,16 @@ Type in expressions to have them evaluated. Type :help for more information. scala> -scala> x: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7) -scala> y: scala.collection.mutable.WrappedArray[Int] = WrappedArray(2, 4, 6, 8, 10, 12, 14) +scala> val x = Array(1,2,3,4,5,6,7) +x: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7) -scala> 56 +scala> val y = x transform (_ * 2) +y: scala.collection.mutable.WrappedArray[Int] = WrappedArray(2, 4, 6, 8, 10, 12, 14) + +scala> println(y.sum) +56 scala> + scala> diff --git a/test/files/run/bug4387.scala b/test/files/run/bug4387.scala new file mode 100644 index 0000000000..f51c9b0572 --- /dev/null +++ b/test/files/run/bug4387.scala @@ -0,0 +1,12 @@ +object Test { + import xml.XML.loadString + def mkElem(arg: String) = <foo a="1" b="2" c="3" d="4" e={arg} /> + + val x1 = mkElem("5") + val x2 = mkElem("50") + + def main(args: Array[String]): Unit = { + assert(x1 == loadString("" + x1)) + assert(x2 != loadString("" + x1)) + } +} diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check index e22e3a58d5..6919eca9bc 100644 --- a/test/files/run/constrained-types.check +++ b/test/files/run/constrained-types.check @@ -1,102 +1,110 @@ -class Annot(obj: Any) extends annotation.Annotation with annotation.TypeConstraint +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> + +scala> class Annot(obj: Any) extends annotation.Annotation with annotation.TypeConstraint defined class Annot ------ -class A { +scala> + +scala> class A { val x = "hello" val y: Int @Annot(x) = 10 override def toString = "an A" } defined class A ------ -val a = new A +scala> + +scala> val a = new A a: A = an A ------ -val y = a.y // should rewrite "this.x" to "a.x" +scala> val y = a.y // should rewrite "this.x" to "a.x" y: Int @Annot(a.x) = 10 ------ -var a2 = new A +scala> var a2 = new A a2: A = an A ------ -val y2 = a2.y // should drop the annotation +scala> val y2 = a2.y // should drop the annotation y2: Int = 10 ------ -object Stuff { +scala> + +scala> object Stuff { val x = "hello" val y : Int @Annot(x) = 10 } defined module Stuff ------ -val y = Stuff.y // should rewrite the annotation +scala> + +scala> val y = Stuff.y // should rewrite the annotation y: Int @Annot(Stuff.x) = 10 ------ -class B { +scala> + +scala> class B { val y: Int @Annot(Stuff.x) = 10 override def toString = "a B" } defined class B ------ -val b = new B +scala> + +scala> val b = new B b: B = a B ------ -val y = b.y // should keep the annotation +scala> val y = b.y // should keep the annotation y: Int @Annot(Stuff.x) = 10 ------ -def m(x: String): String @Annot(x) = x +scala> def m(x: String): String @Annot(x) = x m: (x: String)String @Annot(x) ------ -val three = "three" +scala> + +scala> val three = "three" three: java.lang.String = three ------ -val three2 = m(three:three.type) // should change x to three +scala> val three2 = m(three:three.type) // should change x to three three2: String @Annot(three) = three ------ -var four = "four" +scala> var four = "four" four: java.lang.String = four ------ -val four2 = m(four) // should have an existential bound +scala> val four2 = m(four) // should have an existential bound four2: java.lang.String @Annot(x) forSome { val x: java.lang.String } = four ------ -val four3 = four2 // should have the same type as four2 +scala> val four3 = four2 // should have the same type as four2 four3: java.lang.String @Annot(x) forSome { val x: java.lang.String } = four ------ -val stuff = m("stuff") // should not crash +scala> val stuff = m("stuff") // should not crash stuff: String @Annot("stuff") = stuff ------ -class peer extends annotation.Annotation // should not crash +scala> + +scala> class peer extends annotation.Annotation // should not crash defined class peer ------ -class NPE[T <: NPE[T] @peer] // should not crash +scala> + +scala> class NPE[T <: NPE[T] @peer] // should not crash defined class NPE ------ -def m = { +scala> + +scala> def m = { val x = "three" val y : String @Annot(x) = x y } // x should not escape the local scope with a narrow type m: String @Annot("three") ------ -def n(y: String) = { +scala> + +scala> def n(y: String) = { def m(x: String) : String @Annot(x) = { (if (x == "") m("default") @@ -107,30 +115,40 @@ def n(y: String) = { } // x should be existentially bound n: (y: String)java.lang.String @Annot(x) forSome { val x: String } ------ -class rep extends annotation.Annotation +scala> + +scala> class rep extends annotation.Annotation { } defined class rep ------ -object A { val x = "hello" : String @ rep } +scala> + +scala> object A { val x = "hello" : String @ rep } defined module A +warning: previously defined class A is not a companion to object A. +Companions must be defined together; you may wish to use :paste mode for this. ------ -val y = a.x // should drop the annotation +scala> + +scala> val y = a.x // should drop the annotation y: java.lang.String = hello ------ -val x = 3 : Int @Annot(e+f+g+h) //should have a graceful error message +scala> + +scala> val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message <console>:8: error: not found: value e - val x = 3 : Int @Annot(e+f+g+h) //should have a graceful error message + val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message ^ ------ -class Where(condition: Boolean) extends annotation.Annotation +scala> + +scala> class Where(condition: Boolean) extends annotation.Annotation defined class Where ------ -val x : Int @Where(self > 0 && self < 100) = 3 +scala> + +scala> val x : Int @Where(self > 0 && self < 100) = 3 x: Int @Where(self.>(0).&&(self.<(100))) = 3 ------ +scala> + +scala> diff --git a/test/files/run/constrained-types.scala b/test/files/run/constrained-types.scala index 86fcaade6e..5f7eb7adde 100644 --- a/test/files/run/constrained-types.scala +++ b/test/files/run/constrained-types.scala @@ -3,103 +3,91 @@ * of DeBruijn's . It runs the test using the interpreter so that * the resulting annotated types can be printed out. */ -import scala.tools.nsc._ -import java.io._ -import scala.Console +import scala.tools.nsc.Settings +import scala.tools.partest.ReplTest -object Test { +object Test extends ReplTest { + def code = """ - val testCode = List( - "class Annot(obj: Any) extends annotation.Annotation with annotation.TypeConstraint", +class Annot(obj: Any) extends annotation.Annotation with annotation.TypeConstraint - """class A { - | val x = "hello" - | val y: Int @Annot(x) = 10 - | override def toString = "an A" - |} """, - - - - "val a = new A", - - """val y = a.y // should rewrite "this.x" to "a.x" """, - - - "var a2 = new A", - "val y2 = a2.y // should drop the annotation", - - - """object Stuff { - | val x = "hello" - | val y : Int @Annot(x) = 10 - |}""", - - "val y = Stuff.y // should rewrite the annotation", +class A { + val x = "hello" + val y: Int @Annot(x) = 10 + override def toString = "an A" +} - """class B { - | val y: Int @Annot(Stuff.x) = 10 - | override def toString = "a B" - |}""", +val a = new A +val y = a.y // should rewrite "this.x" to "a.x" +var a2 = new A +val y2 = a2.y // should drop the annotation - "val b = new B", - "val y = b.y // should keep the annotation", +object Stuff { + val x = "hello" + val y : Int @Annot(x) = 10 +} +val y = Stuff.y // should rewrite the annotation - "def m(x: String): String @Annot(x) = x", - "val three = \"three\"", - "val three2 = m(three:three.type) // should change x to three", - "var four = \"four\"", - "val four2 = m(four) // should have an existential bound", - "val four3 = four2 // should have the same type as four2", +class B { + val y: Int @Annot(Stuff.x) = 10 + override def toString = "a B" +} - """val stuff = m("stuff") // should not crash""", +val b = new B +val y = b.y // should keep the annotation +def m(x: String): String @Annot(x) = x + +val three = "three" +val three2 = m(three:three.type) // should change x to three +var four = "four" +val four2 = m(four) // should have an existential bound +val four3 = four2 // should have the same type as four2 +val stuff = m("stuff") // should not crash + +class peer extends annotation.Annotation // should not crash + +class NPE[T <: NPE[T] @peer] // should not crash + +def m = { + val x = "three" + val y : String @Annot(x) = x + y +} // x should not escape the local scope with a narrow type + +def n(y: String) = { + def m(x: String) : String @Annot(x) = { + (if (x == "") + m("default") + else + x) + } + m("stuff".stripMargin) +} // x should be existentially bound - """class peer extends annotation.Annotation // should not crash""", // reported by Manfred Stock - """class NPE[T <: NPE[T] @peer] // should not crash""", // reported by Manfred Stock +class rep extends annotation.Annotation { } - """def m = { - | val x = "three" - | val y : String @Annot(x) = x - | y - |} // x should not escape the local scope with a narrow type""", +object A { val x = "hello" : String @ rep } - """def n(y: String) = { - | def m(x: String) : String @Annot(x) = { - | (if (x == "") - | m("default") - | else - | x) - | } - | m("stuff".stripMargin) - |} // x should be existentially bound""", +val y = a.x // should drop the annotation - "class rep extends annotation.Annotation", - """object A { val x = "hello" : String @ rep }""", - "val y = a.x // should drop the annotation", +val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message - "val x = 3 : Int @Annot(e+f+g+h) //should have a graceful error message", +class Where(condition: Boolean) extends annotation.Annotation - "class Where(condition: Boolean) extends annotation.Annotation", - "val x : Int @Where(self > 0 && self < 100) = 3" - ).map(_.stripMargin) +val x : Int @Where(self > 0 && self < 100) = 3 +""" + override def settings: Settings = { + val s = new Settings - def main(args: Array[String]) { - val settings = new Settings - settings.Xexperimental.value = true - settings.selfInAnnots.value = true - settings.deprecation.value = true + s.Xexperimental.value = true + s.selfInAnnots.value = true + s.deprecation.value = true // when running that compiler, give it a scala-library to the classpath - settings.classpath.value = System.getProperty("java.class.path") - - val interp = new Interpreter(settings) + s.classpath.value = sys.props("java.class.path") - for (cmd <- testCode) { - println(cmd) - interp.interpret(cmd) - println() - println("-----") - } + s } } diff --git a/test/files/run/programmatic-main.scala b/test/files/run/programmatic-main.scala index 3a88252fd3..7fec0f3f98 100644 --- a/test/files/run/programmatic-main.scala +++ b/test/files/run/programmatic-main.scala @@ -8,7 +8,7 @@ object Test { def main(args: Array[String]): Unit = { Console.withErr(Console.out) { - Main process (baseargs ++ Array("-Xshow-phases")) + Main process (baseargs ++ "-Xpluginsdir /does/not/exist/foo/quux -Xshow-phases".split(' ')) } } } diff --git a/test/files/run/repl-assign.check b/test/files/run/repl-assign.check new file mode 100644 index 0000000000..c6b0458f04 --- /dev/null +++ b/test/files/run/repl-assign.check @@ -0,0 +1,20 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> var x = 10 +x: Int = 10 + +scala> var y = 11 +y: Int = 11 + +scala> x = 12 +x: Int = 12 + +scala> y = 13 +y: Int = 13 + +scala> + +scala> diff --git a/test/files/run/repl-assign.scala b/test/files/run/repl-assign.scala new file mode 100644 index 0000000000..ee3c1649d8 --- /dev/null +++ b/test/files/run/repl-assign.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +var x = 10 +var y = 11 +x = 12 +y = 13 + """ +}
\ No newline at end of file diff --git a/test/files/run/repl-paste-2.check b/test/files/run/repl-paste-2.check index fb7a818f1a..435592567d 100644 --- a/test/files/run/repl-paste-2.check +++ b/test/files/run/repl-paste-2.check @@ -2,30 +2,60 @@ Type in expressions to have them evaluated. Type :help for more information. scala> -scala> // Replaying 7 commands from transcript. -val res0 = { 123 } -res0: Int = 123 +scala> scala> 0123 +res4: Int = 0123 -val res1 = { 567 } -res1: Int = 567 +scala> 123 +res5: Int = 123 -val res2 = { res0 + res1 } -res2: Int = 690 +scala> 567 +res6: Int = 567 -val x = dingus +scala> res5 + res6 +res7: Int = 690 + +scala> val x = dingus +<console>:7: error: not found: value dingus + val x = dingus + ^ + +scala> val x = "dingus" +x: java.lang.String = dingus + +scala> x.length +res9: Int = 6 + +scala> x.length + res5 +res10: Int = 12 + +// Replaying 8 commands from transcript. + +scala> 0123 +res0: Int = 83 + +scala> val res5 = { 123 } +res5: Int = 123 + +scala> val res6 = { 567 } +res6: Int = 567 + +scala> res5 + res6 +res1: Int = 690 + +scala> val x = dingus <console>:7: error: not found: value dingus val x = dingus ^ -val x = "dingus" +scala> val x = "dingus" x: java.lang.String = dingus -val res3 = { x.length } -res3: Int = 6 +scala> x.length +res2: Int = 6 -val res4 = { x.length + res3 } -res4: Int = 12 +scala> x.length + res5 +res3: Int = 129 scala> diff --git a/test/files/run/repl-paste-2.scala b/test/files/run/repl-paste-2.scala index 802c627701..f62927791d 100644 --- a/test/files/run/repl-paste-2.scala +++ b/test/files/run/repl-paste-2.scala @@ -2,14 +2,17 @@ import scala.tools.partest.ReplTest object Test extends ReplTest { def code = """ +scala> 0123 +res4: Int = 0123 + scala> 123 -res0: Int = 123 +res5: Int = 123 scala> 567 -res1: Int = 567 +res6: Int = 567 -scala> res0 + res1 -res2: Int = 690 +scala> res5 + res6 +res7: Int = 690 scala> val x = dingus <console>:7: error: not found: value dingus @@ -20,9 +23,9 @@ scala> val x = "dingus" x: java.lang.String = dingus scala> x.length -res3: Int = 6 +res9: Int = 6 -scala> x.length + res3 -res4: Int = 12 +scala> x.length + res5 +res10: Int = 12 """ }
\ No newline at end of file diff --git a/test/files/run/repl-paste.check b/test/files/run/repl-paste.check index 4c9de85e67..50589433cd 100644 --- a/test/files/run/repl-paste.check +++ b/test/files/run/repl-paste.check @@ -1,7 +1,21 @@ Type in expressions to have them evaluated. Type :help for more information. -scala> // Entering paste mode (ctrl-D to finish) +scala> :paste +// Entering paste mode (ctrl-D to finish) + + + class Dingus + { + private val x = 5 + def y = Dingus.x * 2 + } + object Dingus + { + private val x = 55 + } + + val x = (new Dingus).y // Exiting paste mode, now interpreting. diff --git a/test/files/run/repl-transcript.check b/test/files/run/repl-transcript.check index b2a8d2e156..03162451b6 100644 --- a/test/files/run/repl-transcript.check +++ b/test/files/run/repl-transcript.check @@ -2,21 +2,36 @@ Type in expressions to have them evaluated. Type :help for more information. scala> -scala> // Replaying 5 commands from transcript. -class Bippity +scala> scala> class Bippity defined class Bippity -def f = new Bippity +scala> def f = new Bippity f: Bippity -val res5 = { 123 } +scala> 123 res5: Int = 123 -val res6 = { 1 to 100 map (_ + 1) } +scala> 1 to 100 map (_ + 1) res6: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101) -res6.sum + res5 +scala> res6.sum + res5 + +// Replaying 5 commands from transcript. + +scala> class Bippity +defined class Bippity + +scala> def f = new Bippity +f: Bippity + +scala> val res5 = { 123 } +res5: Int = 123 + +scala> val res6 = { 1 to 100 map (_ + 1) } +res6: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101) + +scala> res6.sum + res5 res0: Int = 5273 diff --git a/test/files/run/t3361.scala b/test/files/run/t3361.scala index 17af89a67c..892e36dbd9 100644 --- a/test/files/run/t3361.scala +++ b/test/files/run/t3361.scala @@ -39,10 +39,8 @@ object Test extends App { def insert_1 { val ten = DoubleLinkedList(1 to 10: _*) - ten.insert(DoubleLinkedList(11)) match { - case _: Unit => require(true) - case _ => require(false) - } + ten.append(DoubleLinkedList(11)) + // Post-insert size test require(11 == ten.size) // Post-insert data test diff --git a/test/files/run/t4396.check b/test/files/run/t4396.check new file mode 100644 index 0000000000..58f4fc5138 --- /dev/null +++ b/test/files/run/t4396.check @@ -0,0 +1,5 @@ +hallo +constructor +out:22 +bye +foo diff --git a/test/files/run/t4396.scala b/test/files/run/t4396.scala new file mode 100644 index 0000000000..d67eaa378e --- /dev/null +++ b/test/files/run/t4396.scala @@ -0,0 +1,35 @@ +// #43896 +trait M extends DelayedInit { + def delayedInit(body : => Unit) { + println("hallo") + body + println("bye") + } +} + +class C(init : Int) extends M { + def foo = init + println("constructor") + var x = init + println("out:"+x) +} + +// #4380 +object Main { + def main(argv: Array[String]) { + class Bip { + class Foo { override def toString() = "foo" } + object Main extends App { + val cbn = new Foo() + } + Main.main(Array()) + println(Main.cbn) + } + new Bip + } +} + +object Test extends App { + new C(22) + Main.main(Array()) +} diff --git a/test/files/run/treePrint.scala b/test/files/run/treePrint.scala index ce7dd04499..452aaf390d 100644 --- a/test/files/run/treePrint.scala +++ b/test/files/run/treePrint.scala @@ -35,7 +35,7 @@ object Test { settings.Ycompacttrees.value = true val intp = new IMain(settings, new PrintWriter(new NullOutputStream)) - val power = new Power(intp) + val power = Power(intp) intp.interpret("""def initialize = "Have to interpret something or we get errors." """) power trees code foreach println } diff --git a/test/files/script/fact.args b/test/files/script/fact.args deleted file mode 100644 index 7ed6ff82de..0000000000 --- a/test/files/script/fact.args +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/test/files/script/fact.bat b/test/files/script/fact.bat deleted file mode 100755 index bee0ba25c6..0000000000 --- a/test/files/script/fact.bat +++ /dev/null @@ -1,17 +0,0 @@ -::#!
-:: fact - A simple Scala batch file that prints out the factorial
-:: of the argument specified on the command line.
-
-@echo off
-call scala -nocompdaemon %0 %*
-goto :eof
-::!#
-
-
-val x = argv(0).toInt
-
-def fact(x: Int):Int =
- if(x==0) 1
- else x*fact(x-1)
-
-Console.println("fact(" + x + ") = " + fact(x))
diff --git a/test/files/script/fact.check b/test/files/script/fact.check deleted file mode 100644 index 22aa60821e..0000000000 --- a/test/files/script/fact.check +++ /dev/null @@ -1 +0,0 @@ -fact(5) = 120 diff --git a/test/files/script/fact.scala b/test/files/script/fact.scala deleted file mode 100755 index d48dac6f0f..0000000000 --- a/test/files/script/fact.scala +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# fact - A simple Scala script that prints out the factorial of -# the argument specified on the command line. - -cygwin=false; -case "`uname`" in - CYGWIN*) cygwin=true ;; -esac - -SOURCE="$0"; -if $cygwin; then - if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then - format=mixed - else - format=windows - fi - SOURCE=`cygpath --$format "$SOURCE"`; -fi - -exec scala -nocompdaemon "$SOURCE" "$@" -!# - - -val x = argv(0).toInt - -def fact(x: Int):Int = - if(x==0) 1 - else x*fact(x-1) - -Console.println("fact(" + x + ") = " + fact(x)) diff --git a/test/files/script/second.bat b/test/files/script/second.bat deleted file mode 100755 index 0d7085954d..0000000000 --- a/test/files/script/second.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off
-
-scala -nocompdaemon -e "println(\"My second argument is \" + args(1))" arg1 arg2
diff --git a/test/files/script/second.check b/test/files/script/second.check deleted file mode 100644 index a105b862a1..0000000000 --- a/test/files/script/second.check +++ /dev/null @@ -1 +0,0 @@ -My second argument is arg2 diff --git a/test/files/script/second.scala b/test/files/script/second.scala deleted file mode 100755 index 48b8d73815..0000000000 --- a/test/files/script/second.scala +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -scala -nocompdaemon -e 'println("My second argument is " + args(1))' arg1 arg2 diff --git a/test/files/script/t1015.bat b/test/files/script/t1015.bat deleted file mode 100755 index 7475313d7e..0000000000 --- a/test/files/script/t1015.bat +++ /dev/null @@ -1,12 +0,0 @@ -::#!
-:: t1015 - <description>.
-
-@echo off
-call scala -nocompdaemon %0 %*
-goto :eof
-::!#
-
-case class Test(one : Int, two : Int)
-object Test{
- def apply(one : Int): Test = Test(one, 2);
-}
diff --git a/test/files/script/t1015.scala b/test/files/script/t1015.scala deleted file mode 100755 index 52d67bd6cc..0000000000 --- a/test/files/script/t1015.scala +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# fact - A simple Scala script that prints out the factorial of -# the argument specified on the command line. - -cygwin=false; -case "`uname`" in - CYGWIN*) cygwin=true ;; -esac - -SOURCE="$0"; -if $cygwin; then - if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then - format=mixed - else - format=windows - fi - SOURCE=`cygpath --$format "$SOURCE"`; -fi - -exec scala -nocompdaemon "$SOURCE" "$@" -!# - -case class Test(one : Int, two : Int) -object Test{ - def apply(one : Int): Test = Test(one, 2); -} diff --git a/test/files/script/t1017.bat b/test/files/script/t1017.bat deleted file mode 100755 index 369dbd2aca..0000000000 --- a/test/files/script/t1017.bat +++ /dev/null @@ -1,15 +0,0 @@ -::#!
-::# t1017 - <description>.
-
-@echo off
-call scala -nocompdaemon %0 %*
-goto :eof
-::!#
-
-def foo = {
- bar
-}
-
-var x = 1
-
-def bar = 1
diff --git a/test/files/script/t1017.scala b/test/files/script/t1017.scala deleted file mode 100755 index d1b43ea923..0000000000 --- a/test/files/script/t1017.scala +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# fact - A simple Scala script that prints out the factorial of -# the argument specified on the command line. - -cygwin=false; -case "`uname`" in - CYGWIN*) cygwin=true ;; -esac - -SOURCE="$0"; -if $cygwin; then - if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then - format=mixed - else - format=windows - fi - SOURCE=`cygpath --$format "$SOURCE"`; -fi - -exec scala -nocompdaemon "$SOURCE" "$@" -!# - -def foo = { - bar -} - -var x = 1 - -def bar = 1 |