Commit Graph

14910 Commits

Author SHA1 Message Date
odersky aea1b25c52 Small changes to reflection prompted by code review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25986 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-11 16:08:14 +00:00
extempore 26c0e05a6a Deprecated ambiguous dot syntaxes.
1.+(2) - what is it? Is it 3 or 3.0? Come scala 2.11 you won't
have to not know (or even not know there's something you don't know.)
1.+(2) will then be safely considered equivalent to 1 + 2, because
any dot not followed by a digit is not part of a number.

Primarily, that's these forms:    3.f 3.d 3.

If you prefer an error to a warning, use -Xfuture.

Let's deprecate 012 == 10 too! (See comment.) References SI-5089, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25985 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-11 01:36:12 +00:00
extempore fcf009beb2 Cleanup around typeref creation and rebinding. Review by moors.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25984 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-11 01:35:40 +00:00
extempore 15e52ce04f A comment answering one of adriaan's philosophical musings on why
programs fail, and a test case informed by the comment.  Review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25983 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-11 01:35:21 +00:00
grek 32ad3285f2 Allow to load $class classes using Scala reflection.
Tweaked implementation of invalidClassName method
to exclude *$class clasess from the set of invalid
names. It's not exactly clear what was the intent
of this method in first place so I'm not sure if
it's the best way to fix SI-5176. Added test-case
that covers this issue.

Fixes SI-5176. Review by odersky.



git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25982 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-10 23:57:01 +00:00
extempore a36a3e58f1 Fixing tests, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25981 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-10 22:11:11 +00:00
extempore 608b3cb74d Better virtpatmat situation.
Enabled fancy type inference if opt.virtPatMat is true so one need
not enable -Xexperimental to use El Virto (since I keep wasting time on
edge cases arising from unrelated -Xexperimental-enabled features.)
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25980 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-10 21:17:39 +00:00
extempore 964443eec9 Fix for regression in overriding with defaults.
I should know better than to behave as if usable inferences can
be drawn from a comment like "SYNTHETIC because of DEVIRTUALIZE".
Maybe it was even true when it was written, but no more.
Closes SI-5178, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25979 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-10 21:04:36 +00:00
odersky 8044417227 More refinements for the scratchpad.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25978 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-10 18:15:35 +00:00
odersky 784814c3b2 Removed reflect.{Type, Symbol, Tree, Print} for good.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25977 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-10 16:39:54 +00:00
odersky a924156046 (1) Made ReflectionUtils an object, to take its members out of the reflect package. (2) Removed old Type/Symbol/Tree from reflect package. (3) Got scratchpad to work better. Review by extempore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25976 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-10 16:37:36 +00:00
odersky e513408264 Fixed name of MODULE$ field to make scratchpad work again. Need to look into more robust way of doing things using reflection.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25974 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-09 14:52:53 +00:00
moors 3a9f7a6d10 refactoring virtpatmat into modules, cleaning up
the long-term goal is to separate:
 - analyzing patterns and turning them into extractors that are flatMap'ed and orElse'ed,
   where the structure is expressed in a small intermediate language that
   preserves more pattern matching-specific meaning than trees
 - more advanced analyses on the intermediate representation
 - code generation (patmat IR -> Scala AST) -- this should be trivial

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25973 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-09 09:58:47 +00:00
extempore f568495459 Unified binary representations under AbstractFile.
Created MsilFile as a wrapper around MSILType so we can use AbstractFile
everywhere. This initial attempt is fairly ham-fisted, since I'm not
sure exactly how things are used on the msil side; but it is imposing
undue complication on the loaders. Review by magarcia.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25972 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-08 22:14:34 +00:00
extempore ac20e1d869 Updates for the ten tests I broke recently.
Wow, ten tests, that's unexpected.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25971 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-08 22:14:30 +00:00
extempore 3d99a8b145 Fix binary breakage.
Some philistine who thinks "binary compatibility" is
a computer dating site changed the names of public vals in
Predef classes.  I restored and then deprecated them.

REVIEW BY MOORS.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25970 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-08 20:35:48 +00:00
extempore 105c0a45e5 Fixing experimental feature.
Avoid generating illegal combination of modifiers.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25969 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-08 20:12:57 +00:00
odersky e4a205f3a7 Distentangled platform specific code from loaders so that it becomes possible to reset class symbols to their initial loader wihtout going through an all-or-nothing recursive buildups of package scopes,.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25968 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-08 18:18:19 +00:00
moors 9533bddbac smarter bridges to unapplies
wraps the call to a bridged synthetic unapply(Seq) in a defensive if-test:

if (x.isInstanceOf[expectedType]) real.unapply(x.asInstanceOf[expectedType]) else None

NOTE: the test is WRONG, but it has to be due to #1697/#2337 -- once those are fixed, this one should generate the expected output

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25966 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-08 11:36:30 +00:00
extempore b18b17dacd Fixing logic in structural types.
Check number of arguments before jumping to conclusion that
a primitive seeming structural call might really be primitive.
Closes SI-4766, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25965 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-08 08:01:40 +00:00
extempore ad35f27ddc Third collections commit from Todd Vierling.
Misc cleanups associated with the previous commits:
limiting overly expanded types, fixing externally visible
types for scaladoc, utilizing abstract collection classes
where possible, etc.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25964 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 18:22:56 +00:00
extempore 357182b2b1 Next collections commit from Todd Vierling.
Changes to library code outside the collections.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25963 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 18:22:51 +00:00
extempore f929fbd349 Dropped about 1.5 Mb off scala-library.jar.
This commit and the two subsequent commits were contributed by:

  Todd Vierling <tv@duh.org>.

I combined some commits and mangled his commit messages, but all the
credit is his. This pursues the same approach to classfile reduction
seen in r19989 when AbstractFunctionN was introduced, but applies it to
the collections. Thanks to -Xlint it's easy to verify that the private
types don't escape.

Design considerations as articulated by Todd:

* Don't necessarily create concrete types for _everything_. Where a
subtrait only provides a few additional methods, don't bother; instead,
use the supertrait's concrete class and retain the "with". For example,
"extends AbstractSeq[A] with LinearSeq[A]".

* Examine all classes with .class file size greater than 10k. Named
classes and class names ending in $$anon$<num> are candidates for
analysis.

* If a return type is currently inferred where an anon subclass would be
returned, make the return type explicit. Don't allow the library-private
abstract classes to leak into the public namespace [and scaladoc].

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25962 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 18:22:42 +00:00
odersky c4edc8c5d1 Closes IDE-1000567, SI 5013. No Review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25959 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 15:06:09 +00:00
extempore cc501092cf A couple bits of r25957 lost under time pressure.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25958 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 14:37:59 +00:00
extempore 27fb6adcd1 Another round of pleasing the gods of init order.
Moved all the eagerly evaluated bits to the top of the file so
I can see them all at once.  Let a dozen vals unroll up front so
initialization is more predictable.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25957 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 14:26:52 +00:00
extempore 9673daa316 Fixing checkinit build.
As near as I can tell, -Xcheckinit was failing because a var was read
too early as null rather than waiting for it to be set to its initial
value, null. I guess that's a defensible warning, since one might change
it away from null. Organized the vars in that file better.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25954 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 09:23:50 +00:00
extempore 728adbecc9 Fix crash with HK types.
Another page in the storied history of "call .tpe when one should have
called .tpeHK", in this case leading to a crash of stacktraciness.
Closes SI-5152, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25953 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 08:54:57 +00:00
extempore 6202225a57 Fixed hang in typechecker.
Another page in the storied history of "check the normalized type,
then act on the unnormalized type", in this case leading to a tight
loop of foreverness.  Closes SI-5156, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25952 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-07 07:49:17 +00:00
michelou 9a95bc79c4 Closed SI-5135
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25950 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-06 20:11:54 +00:00
dragos 7c4912023a Changed presentation tests to use .flags instead of .opts for passing
options to the presentation compiler.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25949 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-06 17:38:45 +00:00
odersky d2bcec13f8 Fixed askLinkPos problem in reported by failing test in presentation/akka.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25948 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-06 15:52:54 +00:00
Mirco e04aed5299 Added akka.opts file (for presentation compiler test) which allows to set settings on the compiler's instance. Lines that begin with a sharp are skipped. review by odersky.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25947 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-05 16:16:40 +00:00
extempore 940e217cbd Revert "Fix for Enumeration."
Oops, didn't mean to commit that one.  Opens SI-5147.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25946 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 21:47:55 +00:00
extempore 17dcf294b2 Minor change to get closer to building under -Xexperimental.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25945 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 21:09:24 +00:00
extempore 01ec69f9ba Attempt to fix failing test.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25944 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 21:09:20 +00:00
extempore bdbf22a340 Fix for Enumeration.
Closes SI-5147.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25943 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 21:09:17 +00:00
extempore 2ac74bcbd1 More elaborate error message.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25942 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 21:09:14 +00:00
extempore ae1969220f More repl work.
Hardened the repl against a bunch of erroneous conditions.
Added a :reset command which causes the repl to forget everything
you have told it.  Added classloader tracing when repl tracing is
enabled.  :reset is not that useful in its current form but
it's the precursor to something more interesting.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25941 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 14:53:50 +00:00
extempore 1af12b4157 Fix for some repl bitrot.
Exception handling beset by entropy. Restored some order. The output of
the test may not be stable across platforms, in which case I'll take the
usual step of reverting it, thereby achieving victory over failure by
testing nothing instead of testing something. No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25938 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 08:25:30 +00:00
extempore 4ea663da28 Some modest optimizations and beauty treatments.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25937 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 05:54:01 +00:00
extempore f5913f5d4e Repl deadlock fix.
Found the cure for the hanging repl introduced three comits ago.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25936 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-04 04:17:02 +00:00
odersky c6f1c3b355 Trying to fix sdt core build.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25935 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-03 22:29:22 +00:00
extempore d92d6cd751 Reflection classloader adjustment.
With this change, one can use the reflective compiler with the
scala libs on the boot classpath (the default) or not (with -nobootcp)
and it will work either way.  Maybe it will work in sbt now too, but
I haven't tried it.  Since I bet you will try it, review by grek.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25932 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-03 04:51:58 +00:00
extempore d251c5884b ScalaClassLoader changes.
Lots of fiddling in the interests of a better classloading future.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25931 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-03 04:51:52 +00:00
plocinic 99fe7861d7 Begone t1737... at least until folks figure out what's wrong with you. no review
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25930 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-02 14:34:35 +00:00
plocinic 1f9ca0009f attempt to bring trunk build to normal state. fixing mirco's commit, adapted the test. Also currently hyperlinking returns NoPosition in one case. I prefered 'fixing' it this way rather than disabling the whole test. I believe the problem is when adapting ThisType to new run but I didn't have more time to investigate. review by mirco.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25929 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-02 10:51:53 +00:00
odersky 657720b981 Fixed type unsoundness problem in t5120 and also discovered by roman.kalukiewicz@gmail.com. Fix should be refined further, as I am not convinced we are quite done yet. Review by moors.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25928 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-01 17:16:51 +00:00
Mirco b8fce95593 Made some minor change in the presentation compiler testing framework to make it more robust when (unexpected) NoPosition values are returned. That makes test failure smoother and more information can be hence gathered from the logged trace. no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25924 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-01 10:45:11 +00:00
extempore 428fa71fdf Fix for SI-3415 regression.
Now there's an unlikely fix.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25923 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-01 02:43:03 +00:00