| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This experimental option typechecked arguments of annotations
with an injected value in scope named `self`:
@Foo(self.foo < 1)
This has been slated for removal [1] for some time.
This commit removes it in one fell swoop, without any attempt
at source compatibility with code that constructs or pattern
matches on AnnotatedType.
[1] https://groups.google.com/d/msg/scala-internals/VdZ5UJwQFGI/C6tZ493Yxx4J
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One last flurry with the broom before I leave you slobs to code
in your own filth. Eliminated all the trailing whitespace I
could manage, with special prejudice reserved for the test cases
which depended on the preservation of trailing whitespace.
Was reminded I cannot figure out how to eliminate the trailing
space on the "scala> " prompt in repl transcripts. At least
reduced the number of such empty prompts by trimming transcript
code on the way in.
Routed ConsoleReporter's "printMessage" through a trailing
whitespace stripping method which might help futureproof
against the future of whitespace diseases. Deleted the up-to-40
lines of trailing whitespace found in various library files.
It seems like only yesterday we performed whitespace surgery
on the whole repo. Clearly it doesn't stick very well. I suggest
it would work better to enforce a few requirements on the way in.
|
|
|
|
|
| |
unmoored doc comment" warning when building distribution for
scala itself.
|
|
|
|
|
|
|
|
|
|
|
| |
TypeKinds said SHORT <:< INT. But that's not quite true on the JVM. You
can assign SHORT to INT, but you can't assign an ARRAY[SHORT] to
ARRAY[INT]. Since JVM arrays are covariant it's clear that assignability
and subtyping are distinct on the JVM.
This commit adds an isAssignable method and moves the rules about
the int sized primitives there. ICodeCheckers, ICodeReader, and
GenICode are all updated to use isAssignable instead of <:<.
|
|
|
|
|
|
|
|
|
| |
TypeKinds said INT <:< LONG. But that's not true on the JVM, you need
a coercion to move up. And GenICode#adapt was checking for just that
special case.
This commit removes the INT <:< LONG rule and then removes the special
case from GenICode#adapt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In preparation for dealing with a problem in TypeKinds, this commit
does some cleanup of code related to doing coercions.
* Comments are added to clarify.
* A println when converting between BOOL and anything else is removed
and the code is allowed to flow through to an assertion.
* Assertions are refactored to use string interpolation.
* A few pattern matches were reformulated to equivalent variants
In addition, a test is created for SI-107, the bug that necessitated
the special case in GenICode#adapt for LONG coercion
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling normalize is very aggressive and is usually the wrong
thing. It is one of the leading contributors to non-determinism
in compiler outcomes (often of the form "I gave a debugging or
logging compiler option and it started/stopped working") and
should be used only in very specific circumstances.
Almost without exception, dealiasWiden is what you want; not
widen, not normalize. If possible I will remove normalize from
Type entirely, making it private to those areas of the compiler
which actually require it.
|
|
|
|
|
|
|
|
| |
It lives on in a branch born from this commit's parent.
It's abrupt; no attempt is made to offer a "smooth transition"
for the serious msil userbase, population zero. If anyone feels
very strongly that such a transition is necessary, I will be
happy to talk you into feeling differently.
|
| |
|
|
|
|
| |
This reverts commit 951fc3a486.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I want to get this commit into the history because
the tests pass here, which demonstrates that every commented
out method is not only unnecessary internally but has zero
test coverage. Since I know (based on the occasional source
code comment, or more often based on knowing something about
other source bases) that some of these can't be removed
without breaking other things, I want to at least record
a snapshot of the identities of all these unused and
untested methods.
This commit will be reverted; then there will be another
commit which removes the subset of these methods which I
believe to be removable. The remainder are in great need of
tests which exercise the interfaces upon which other
repositories depend.
|
|
|
|
|
|
|
|
|
| |
A dizzying number of unused imports, limited to files
in src/compiler. I especially like that the unused import
option (not quite ready for checkin itself) finds places
where feature implicits have been imported which are no
longer necessary, e.g. this commit includes half a dozen
removals of "import scala.language.implicitConversions".
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* commit 'refs/pull/1574/head': (24 commits)
Fixing issue where OSGi bundles weren't getting used for distribution.
Fixes example in Type.asSeenFrom
Fix for SI-6600, regression with ScalaNumber.
SI-6562 Fix crash with class nested in @inline method
Brings copyrights in Scaladoc footer and manpage up-to-date, from 2011/12 to 2013
Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013
SI-6606 Drops new icons in, replaces abstract types placeholder icons
SI-6132 Revisited, cleaned-up, links fixed, spelling errors fixed, rewordings
Labeling scala.reflect and scala.reflect.macros experimental in the API docs
Typo-fix in scala.concurrent.Future, thanks to @pavelpavlov
Remove implementation details from Position (they are still under reflection.internal). It probably needs more cleanup of the api wrt to ranges etc but let's leave it for later
SI-6399 Adds API docs for Any and AnyVal
Removing actors-migration from main repository so it can live on elsewhere.
Fix for SI-6597, implicit case class crasher.
SI-6578 Harden against synthetics being added more than once.
SI-6556 no assert for surprising ctor result type
Removing actors-migration from main repository so it can live on elsewhere.
Fixes SI-6500 by making erasure more regular.
Modification to SI-6534 patch.
Fixes SI-6559 - StringContext not using passed in escape function.
...
Conflicts:
src/actors-migration/scala/actors/migration/StashingActor.scala
src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
src/compiler/scala/tools/nsc/settings/AestheticSettings.scala
src/compiler/scala/tools/nsc/transform/Erasure.scala
src/library/scala/Application.scala
src/library/scala/collection/immutable/GenIterable.scala.disabled
src/library/scala/collection/immutable/GenMap.scala.disabled
src/library/scala/collection/immutable/GenSeq.scala.disabled
src/library/scala/collection/immutable/GenSet.scala.disabled
src/library/scala/collection/immutable/GenTraversable.scala.disabled
src/library/scala/collection/mutable/GenIterable.scala.disabled
src/library/scala/collection/mutable/GenMap.scala.disabled
src/library/scala/collection/mutable/GenSeq.scala.disabled
src/library/scala/collection/mutable/GenSet.scala.disabled
src/library/scala/collection/mutable/GenTraversable.scala.disabled
src/library/scala/collection/parallel/immutable/ParNumericRange.scala.disabled
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
These are the call sites which formerly could be seen to
call .tpe on a symbol with unapplied type parameters. Now
each such call site makes an explicit choice about what is
intended for the result type.
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
src/compiler/scala/tools/nsc/ast/TreeGen.scala
src/compiler/scala/tools/nsc/settings/AestheticSettings.scala
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These are the regexp replacements performed:
Sxcala
-> Scala
Copyright (\d*) LAMP/EPFL
-> Copyright $1-2012 LAMP/EPFL
Copyright (\d*)-(\d*)(,?) LAMP/EPFL
-> Copyright $1-2012 LAMP/EPFL
Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL
-> Copyright $1-2012 Scala Solutions and LAMP/EPFL
\(C\) (\d*)-(\d*) LAMP/EPFL
-> (C) $1-2012 LAMP/EPFL
Copyright \(c\) (\d*)-(\d*)(.*?)EPFL
-> Copyright (c) $1-2012$3EPFL
The last one was needed for two HTML-ified copyright notices.
Here's the summarized diff:
Created using
```
git diff -w | grep ^- | sort | uniq | mate
git diff -w | grep ^+ | sort | uniq | mate
```
```
- <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
- copyright.string=Copyright 2002-2011, LAMP/EPFL
- <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/>
- * Copyright 2002-2011 LAMP/EPFL
- * Copyright 2004-2011 LAMP/EPFL
- * Copyright 2005 LAMP/EPFL
- * Copyright 2005-2011 LAMP/EPFL
- * Copyright 2006-2011 LAMP/EPFL
- * Copyright 2007 LAMP/EPFL
- * Copyright 2007-2011 LAMP/EPFL
- * Copyright 2009-2011 Scala Solutions and LAMP/EPFL
- * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL
- * Copyright 2010-2011 LAMP/EPFL
- * Copyright 2012 LAMP/EPFL
-# Copyright 2002-2011, LAMP/EPFL
-* Copyright 2005-2011 LAMP/EPFL
-/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */
-rem # Copyright 2002-2011, LAMP/EPFL
```
```
+ <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
+ copyright.string=Copyright 2002-2012 LAMP/EPFL
+ <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/>
+ * Copyright 2002-2012 LAMP/EPFL
+ * Copyright 2004-2012 LAMP/EPFL
+ * Copyright 2005-2012 LAMP/EPFL
+ * Copyright 2006-2012 LAMP/EPFL
+ * Copyright 2007-2012 LAMP/EPFL
+ * Copyright 2009-2012 Scala Solutions and LAMP/EPFL
+ * Copyright 2010-2012 LAMP/EPFL
+ * Copyright 2011-2012 LAMP/EPFL
+# Copyright 2002-2012 LAMP/EPFL
+* Copyright 2005-2012 LAMP/EPFL
+/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */
+rem # Copyright 2002-2012 LAMP/EPFL
```
|
|/
|
|
|
|
|
|
| |
enteringPhase and exitingPhase are our unambiguously named
phase time travel methods. atPhase is deprecated. Other methods
and uses have all been brought into line with that.
Review by @lrytz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Consolidating many islands of name organization. Folds NameManglers
into StdNames. Brings more of the string constants together with similar
constants. Move name manipulation methods which produce TypeNames
into object tpnme rather than nme.
- Starting on MethodSymbolApi, ClassSymbolApi, etc so we can put
sensible methods on sensible entities. This pushed into Definitions,
where I pulled a whole bunch out of the api side (or at least marked
my intention to do so -- too many tests use them to make them easy to
remove) and on the compiler side, returned something more specific than
Symbol a bunch of places.
- Added a number of conveniences to Definitions to make it easier to
get properly typed symbols.
Note: one way in which you might notice having better typed Symbols is
with Sets, which have the annoying property of inferring a type based on
what they've been constructed with and then hard failing when you test
for the presence of a more general type. So this:
val mySet = Set(a, b)
println(mySet(c))
..goes from compiling to not compiling if a and b receive more specific
types (e.g. they are MethodSymbols) and c is a Symbol or ClassSymbol or
whatever. This is easily remedied on a site-by-site basis - create
Set[Symbol](...) not Set(...) - but is an interesting and unfortunate
consequence of type inference married to invariance.
The changes to DummyMirror where things became ??? were driven by the
need to lower its tax; type "Nothing" is a lot more forgiving about changes
than is any specific symbol type.
|
| |
|
|
|
|
|
|
|
| |
Finally my dream of orderliness is within sight.
It's all pretty self-explanatory. More polymorphism, more immutable
identity, more invariants.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I guess these are self-explanatory.
@inline final def afterErasure[T](op: => T): T = afterPhase(currentRun.erasurePhase)(op)
@inline final def afterExplicitOuter[T](op: => T): T = afterPhase(currentRun.explicitouterPhase)(op)
...
@inline final def beforeTyper[T](op: => T): T = beforePhase(currentRun.typerPhase)(op)
@inline final def beforeUncurry[T](op: => T): T = beforePhase(currentRun.uncurryPhase)(op)
This commit is basically pure substitution. To get anywhere interesting
with all the phase-related bugs we have to determine why we use atPhase
and capture that reasoning directly. With the exception of erasure, most
phases don't have much meaning outside of the compiler. How can anyone
know why a block of code which says atPhase(explicitouter.prev) { ... }
needs to run there? Too much cargo cult, and it should stop. Every usage
of atPhase should be commented as to intention.
It's easy to find bugs like
atPhase(uncurryPhase.prev)
which was probably intended to run before uncurry, but actually runs
before whatever happens to be before uncurry - which, luckily enough, is
non-deterministic because the continuations plugin inserts phases
between refchecks and uncurry.
% scalac -Xplugin-disable:continuations -Xshow-phases
refchecks 7 reference/override checking, translate nested objects
uncurry 8 uncurry, translate function values to anonymous classes
% scalac -Xshow-phases
selectivecps 9
uncurry 10 uncurry, translate function values to anonymous classes
Expressions like atPhase(somePhase.prev) are never right or are at best
highly suboptimal, because most of the time you have no guarantees about
what phase precedes you. Anyway, I think most or all atPhases expressed
that way only wanted to run before somePhase, and because one can never
be too sure without searching for documentation whether "atPhase" means
before or after, people err on the side of caution and overshoot by a
phase. Unfortunately, this usually works. (I prefer bugs which never work.)
|
|
|
|
|
| |
Hey, that new warning works. No review.
|
|
|
|
|
|
|
|
|
|
|
| |
Expanded the range of a warning, and made suppressed warnings visible.
Modified the positioning of "permanently hidden" errors so that when
there is more than one, the later ones are not ignored. Also changed the
error suppression code to emit the error anyway if -Ydebug was given (it
is prefixed with "[suppressed] ".) Since I can't be the only one who
wondered where his errors were vanishing to. No review.
|
|
|
|
|
|
| |
comments into code comments for reference by me or some lucky future
person. No review.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
distribution can now be built with that option, with or without
optimization, and almost all tests cases can. (Those which can't are due
to different -Ycheck: issues.)
Major changes of interest are as follows:
* LOAD_EXCEPTION and THROW are parameterized on the throwable symbol.
* Does not squash all traits down to AnyRef, but instead deals with
issues as they arise. By observation the cases where one needs a "Foo
with Product" to manifest as both a "Foo" and a "Product" at different
places are quite rare, so we need not throw out the whole baby. *
Exception handlers now have positions. * The remaining checker failures
removed, such as CALL_METHOD wanting to pop a value off the stack
after calling a constructor. * Many multiply defined values such as
REFERENCE(ObjectClass) put in one place (ICodes.scala) and reused. *
-Ycheck:icode output (if also given -Ydebug) worthy of Michelangelo.
Here is a class and the -Ycheck:icode -Ydebug output for f's block.
class A {
def f(x: Int, y: String) =
try println(x + y.length)
catch { case x: NullPointerException => () }
}
** Checking Block 4 [S: 3, 2] [P: 1] <closed>
1-> REF(singleton class Predef) 3 + LOAD_MODULE object Predef
2-> INT 3 + LOAD_LOCAL(value x)
3-> REF(class String) 3 + LOAD_LOCAL(value y)
2<- REF(class String) 3 - CALL_METHOD java.lang.String.length (dynamic)
3-> INT 3 + CALL_METHOD java.lang.String.length (dynamic)
2<- INT 3 - CALL_PRIMITIVE(Arithmetic(ADD,INT))
1<- INT 3 - """
2-> INT 3 + CALL_PRIMITIVE(Arithmetic(ADD,INT))
1<- INT 3 - BOX INT
2-> REF(class Integer) 3 + BOX INT
1<- REF(class Integer) 3 - CALL_METHOD scala.Predef.println (dynamic)
0<- REF(singleton class Predef) 3 - CALL_METHOD scala.Predef.println (dynamic)
Review by dragos (I marked the specific spots I thought of interest with
"PP to ID" which makes it sound like I'm talking to my primal self. Next
week on programmer theater: "PP to SUPEREGO.")
|
|
|
|
|
|
|
|
|
|
|
| |
Modified the lub calculation in TypeKinds to avoid the icode checker
failures described in ticket #3872. This does not alter the compiler's
lub calculation as I'd hoped because I could not figure out how to
accomplish this without having unintended consequences. I think that
either Symbol.isLess could be adjusted, or perhaps the implementation of
spanningTypes, or other places... but it eluded me and I defer to the
type wizards. No review.
|
|
|
|
|
|
|
|
|
|
|
| |
Determined that half a dozen ways of checking for varargs and
by-name-ness in param lists exceeded the legal limit. Also assessed that
names which are only used as type names would be a lot easier to deal
with if we created them as type names up front. Performed the changes
implied by the preceding along with a partial cleanup on TreeInfo which
one can see hasn't had a good look in a long time. (And still hasn't.)
No review.
|
|
|
|
|
|
|
|
| |
Modified typekinds to offer a more general lub when it encounters
interfaces so it does not end up in a disagreement with the jvm.
References #3872, but modifying the compiler lubs is not yet done.
Review by dragos.
|
|
|
|
|
|
| |
Integrating feedback from martin and iulian into recent patches and
prettifying checker output. No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
build/pack/bin/scalac -d /tmp -Ycheck-debug -Ycheck:all \
src/compiler/scala/tools/nsc/Global.scala
That blows up in constructors as most files do, so also try it with
-Ycheck:icode to see the pretty icode output (for a little while anyway,
after which it will again blow up.)
Our work has only just begun! See test/checker-tests/fail*.scala for
11 examples of places where the checker cries foul. Many of them are
telling us about real issues and we should listen, but I will need help
to figure out which are legitimate and which should be eliminated by
altering the checkers.
This patch also hacks on some territory the checkers drew me into,
especially TypeKinds, where I figured anything which had been commented
out since 2005 was fair game.
(Optional) review by dragos. (The one place I know I could use a look is
in Checkers.scala, because I had to relax some checks and add at least
one newer opcode.)
|
|
|
|
|
|
| |
and still came out of the washing machine smiling. Already reviewed by a
certain i. dragos so no review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(a) The bytecode that Scala.NET emitted had a tough time in
passing peverify due to valuetypes (aka structs) and their related
managed-pointer types. With these changes (details in [1] and [2])
external APIs exposing valuetypes can be used, yet the extra step of
supporting defining valuetypes in Scala programs has been left for
later. Supporting the unsigned integral valuetypes (used, among others,
by IKVM) is also pending.
(b) A very first step towards generics can be found in
TypeParser.parseClass, for the time being commented out (search for
the label "TODO CLR generics"). It's commented out because without
CLRManifests codegen won't work as expected. Details in [3].
review by rytz
Refs:
[1]
http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2010Q3/Bootstr
apping3.pdf
[2]
http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2010Q3/Bootstr
apping4.pdf
[3]
http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2010Q2/SigToTy
pe.pdf
|
|
|
|
|
| |
Removed more than 3400 svn '$Id' keywords and related junk.
|
|
|
|
|
|
|
|
|
|
|
| |
A few yards short of the goal posts attempt at making our usage of
Throwable subclasses more consistent. This patch eliminates a lot of
ad hoc Exception/Error/etc. creation and various arbitrary choices are
rendered slightly less arbitrary. From now on let's try not to use the
word "Exception" or "Error" in the names of Throwable subclasses unless
they actually derive (and make sense to derive) from Exception or Error.
Review by community.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
as inspiration to chase down a few spots using get and getOrElse in
suboptimal fashion.
|
|
|
|
|
|
| |
Faster optimizer by caching successors/predecessors in basic blocks, and
better lub for icode
|
|
|
|
|
|
|
| |
fixing a long-standing bug in fjbg and recompiling fjbg.jar, which had
the side effect of revealing that the current fjbg jar had never been
recompiled with target 1.5, so now it's smaller and (I imagine) faster.
|
|
|
|
|
|
| |
Removed everything deprecated in 2.7.3 or earlier except the lower case
primitive type aliases, plus associated fixes.
|
|
|
|
|
| |
Fixed the optimizer for inlining correctly ScalaRunTime.inlinedEquals
|
|
|
|
|
|
| |
improved annotations copying (documentation, moved meta-annotations,
added tests)
|
| |
|