| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
- added test for “span” and “fromNow” qualifiers
- make those actually work even when there is an expected type
- add ScalaDoc to them
- verify (and fix) conversion Deadline -> FiniteDuration
- also make Int * Duration => FiniteDuration work (and test it)
|
|
|
|
|
|
|
|
| |
More use of implicit classes and value classes; aliased units to
make importing TimeUnit and TimeUnit._ unnecessary; placed some
classes in their own files because "the unit of compilation is
the file" and we shouldn't bundle more than necessary; fixed some
examples.
|
|
|
|
|
|
|
|
|
| |
so that the full package can be imported naturally:
import scala.concurrent.duration._
will give you all the types (Duration, FiniteDuration, Deadline) and the
DSL for constructing these.
|
|
|
|
|
| |
- also rename divisor arguments to “divisor”
- and add a scalacheck for multiplication overflow detection
|
|
|
|
|
|
|
|
|
| |
- without this "2.seconds * 2" will not return FiniteDuration but
Duration
- added test case verifying this behavior
- matches normal arithmetics: integers throw on div-by-zero while
doubles yield infinity; extended here to include overflow protection
on integer multiplication
|
|\
| |
| | |
Fixed SI-6353: applyDynamic with sugared applications
|
| |
| |
| |
| |
| |
| |
| | |
- Accept sugared applications such as x(1) if x implements Dynamic,
so x(1) gets re-written to x.apply(1).
- When picking a dynamic rewrite for x.apply(1), favor applyDynamic
instead of the default selectDynamic.
|
|\ \
| | |
| | | |
moves isImplicit from TermSymbol to Symbol
|
| | |
| | |
| | |
| | | |
Because classes can also be implicit.
|
|\ \ \
| | | |
| | | | |
Topic/empty array
|
| | | |
| | | |
| | | |
| | | | |
This reverts most of commit 9d84e89d2 .
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reminds me of at least one reason I didn't put them
here before: I don't feel like I can return these from calls
to Array.empty, because there's no way of knowing whether
anyone has been relying upon this property:
scala> Array.empty[Byte] eq Array.empty[Byte]
res0: Boolean = false
Since that is exactly the property I need to alter.
The test above is true in all the "real" collections,
which is all the more reason to be concerned that someone
might be using empty arrays as not-equivalent sentinels.
I can still move them here, but it'd be a lot better if
array creation could use them - not only def empty but
def apply[T: ClassTag](xs: T*): Array[T]
which probably creates millions of empty arrays where
one would do in almost every case.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6336 Disallows value types in structuralal refinements
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Structural refinements already have a number of restrictions, e.g. cannot refer to
type parameters of enclosing classes. We need to disallow value classes as well.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
SI-4478 Replaces wrt with (hopefully) slightly improved wording.
|
| | | | | |
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
More relative path elimination.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Some names I missed in 55b609458fd .
How one might know when one is done:
mkdir scratch && cd scratch
mkdir annotation beans collection compat concurrent io \
math parallel ref reflect runtime scala sys testing \
text tools util xml
scalac $(find ../src/library -name '*.scala')
Until recently that would fail with about a billion errors. When it
compiles, that's when you're done. And that's where this commit
takes us, for src/library at least.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
test suite for SI-6329
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Eugene pullreq 1306
|
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* commit 'refs/pull/1306/head':
SI-6356 reflection now supports Java annotations
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
Except for one thingie: java enums are currently not understood
by Scala reflection, hence they aren't yet supported in annotations.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
Pullreq 1306
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Paradoxically it has less duplication but is longer.
That's the way it goes sometimes.
|
| |/ / /
| | | |
| | | |
| | | |
| | | | |
Except for one thingie: java enums are currently not understood
by Scala reflection, hence they aren't yet supported in annotations.
|
|\ \ \ \
| |/ / /
|/| | | |
deals with magic
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
First I was quite skeptical about Paul's dislike of names that contain
"magic" in them.
However when I went through the code and tried to think of "magic"-less
alternatives, it became apparent that resulting names are much better
than the originals.
Therefore I removed all the magic from reflection and macros. Feels good.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously magic classes such as NothingClass were entered twice
into root mirrors of java universes. No idea how this managed not to blow up.
Now this problem is fixed.
Also, as usual when I gain understanding of something, this allows to come up
with better names. `magicSymbols` are now split into three collections:
`magicallyEnteredClasses`, `magicallyEnteredMethods` and `magicallyHijackedSymbols`.
|
|\ \ \ \
| | | | |
| | | | | |
cleaning up reflection
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As recent experience shows, it's hardly possible to provide a global cache
that persists between compilation runs: http://groups.google.com/group/scala-ide-user/browse_thread/thread/b1cab5588ff21f7f.
Therefore I think we need to remove Context.globalCache.
Speaking of a per-run cache, it looks like Context.cache can be
to a certain extent emulated with attachments. Otherwise, one could write
a JVM-wide static cache weakly indexed by compilation run instances
(that are available via c.currentRun).
For now I think we need to remove both caches. If macro writers really need
that functionality, we could come up with a well-thought API later.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
1) parseExpr => parse
2) runExpr => eval
3) Introduces compile(Tree): () => Any, since it has frequent uses
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Internal face of AnnotationInfos is bound by backward compatibility
with compiler plugins and possibly SBT, but the public face can
be shaped in whatever fashion we like.
Hence I cleaned up the names: AnnotationInfo itself got renamed to
just Annotation, AnnotArgs got renamed to just Arguments and so on.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously Attachments allowed multiple attachments that
correspond to the same attachment type.
This created a potential for confusion, given that Attachments.get
only searched for the first attachment of a given type.
Hence I made Attachments.add overwrite previously existing attachments
of a given type and renamed it to Attachments.update, so that the name
suits the intention better.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Unfortunately we cannot remove this node, because it's emitted by typer
and, therefore, can be seen by macros and pickled as a part of annotations.
Therefore we have to expose UnApply in the API.
Experimental status of scala-reflect.jar will give us some leeway to evict it
from the compiler (and consequently from the API) by 2.10.1.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Looks like narrow doesn't help us solve the problem it was intended for:
http://groups.google.com/group/scala-user/browse_thread/thread/9f5d55ebfcc8e60a
I believe we'll be on a safer side if we remove it until it's really needed.
|
| | | | |
| | | | |
| | | | |
| | | | | |
It's clearly redundant and also is susceptible to initialize-based bugs.
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Introduced by erasure - therefore it can be seen
neither by macros, nor by runtime reflection.
Despite never being pickled, ApplyDynamic is supported by unpickler
so I couldn't move it exclusively to scala-compiler.jar.
Figuring out the mysterious reason for pickling ApplyDynamic is left
to future work.
|
|\ \ \ \
| | | | |
| | | | | |
A little cleanup along the Any to AnyRef trail.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Followup to 35316be and d3f879a.
- Remove obsolete comments and replace them with a test.
- Don't emit error addendum unless we know we're dealing
with a value class.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix for SI-6245 with workaround for SI-2296.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
protected/super accessor issue: Don't subvert the creation of the
standard protected accessor with the java interop accessor. For
SI-2296, the compiler emits an error instead of causing an illegal
access error at runtime.
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
Topic/empty array optimization
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
There's that empty array. When compiling "trait Foo", this
took me from allocating 44,410 empty arrays to allocating
383 of them.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Because there are lots of times when you just need an
array and shouldn't have to allocate one every time or
pick a random spot to cache yet another empty array.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Eliminate breaking relative names in source.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
These things are killing me. Constructions like
package scala.foo.bar.baz
import foo.Other
DO NOT WORK in general. Such files are not really in the
"scala" package, because it is not declared
package scala
package foo.bar.baz
And there is a second problem: using a relative path name means
compilation will fail in the presence of a directory of the same
name, e.g.
% mkdir reflect
% scalac src/reflect/scala/reflect/internal/util/Position.scala
src/reflect/scala/reflect/internal/util/Position.scala:9: error:
object ClassTag is not a member of package reflect
import reflect.ClassTag
^
src/reflect/scala/reflect/internal/util/Position.scala:10: error:
object base is not a member of package reflect
import reflect.base.Attachments
^
As a rule, do not use relative package paths unless you have
explicitly imported the path to which you think you are relative.
Better yet, don't use them at all. Unfortunately they mostly work
because scala variously thinks everything scala.* is in the scala
package and/or because you usually aren't bootstrapping and it
falls through to an existing version of the class already on the
classpath.
Making the paths explicit is not a complete solution -
in particular, we remain enormously vulnerable to any directory
or package called "scala" which isn't ours - but it greatly
limts the severity of the problem.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Two pull requests crossed in the night.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6331 deconst If type / refine equality of floating point Constant types.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Incorporate `tag`, which is considered by equals, to reduce collisions.
- Use the result of floatToRawIntBits(value) / doubleToRawLongBits(value),
rather than value. This wasn't strictly necessary as (0d.## == (-0d).##)
but this is more obviously correct.
|