| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
don't try to create tags w/o scala-reflect.jar
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since recently type tags have relocated to scala-reflect.jar,
meaning that they are no longer always on library classpath.
In the compiler we do have code that generates type tags, and this code
is bound to fail if scala-reflect.jar isn't there.
I though this wouldn't be a problem, because type tag materialization
is only going to be triggered by users explicitly requesting a type tag.
That's generally true, but I overlooked a corner case. Since we provide
manifest <-> type tag compatibility, manifest lookup can sometimes trigger
tag lookup, which might result in tag synthesis, which blows up like this:
http://groups.google.com/group/scala-internals/browse_thread/thread/166ce4b71b7c46bb
This commit also ensures that type tag generation/interop doesnt sneak into the
code of the libraries that don't have scala-reflect.jar on their classpath.
For details refer to the discussion at scala-internals:
http://groups.google.com/group/scala-internals/browse_thread/thread/72f6ce3010f4d8
|
| |
| |
| |
| |
| |
| |
| | |
We now apply erasure of value classes everywhere. previously,
erasure was disabled in the value class itself. This led to
irregegularities and bugs. See test run/valueclasses-pavlov.scala
for something that led to a ClassCastException before.
|
| |
| |
| |
| |
| | |
Added a default value to a hashmap so that we can work with it
without Option acrobatics.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Guards against bridge methods that clash with other methods. Two
tests: The neg test is the original ticket. The run test tweaks
things slightly so that the generated bridge method does not clash,
and tests that the necessary unboxings are indeed performed at
runtime.
|
|\ \
| | |
| | | |
Fix problem with names encoding in scalap.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The refactoring performed in 020053c321 made use of naming encoding
more consisted but introduced a regression in scalap. The problem
is that the old encoder that scalap had didn't escape any characters
that were not included in its opcode list.
`NameTransformer` performs full encoding so it also encodes dots
that are being used as separators for packages. Therefore, in order
to retain the old behaviour we need to split the name by dots before
feeding each fragment to `NameTransformer`.
Review by @paulp.
|
|\ \ \
| | | |
| | | | |
SI-5943 toolboxes now autoimport Predef and scala
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously tb.typeCheck used default typer, which builds upon NoContext.
Changing the context to analyzer.rootContext(NoCompilationUnit, EmptyTree)
fixed the missing imports problem.
Unfortunately this doesn't help in cases like "math.sqrt(4.0)" because of
https://issues.scala-lang.org/browse/SI-6393. But anyways I'm adding
this test case to pending.
|
|\ \ \ \
| | | | |
| | | | | |
existentially typed macro expansions now work fine
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If one tries to compile the following code with the parent of this commit:
ru.reify(new Object().getClass)
then the following error will occur:
Test.scala:2: error: type mismatch;
found : $u.Expr[Class[_ <: Object]]
required: reflect.runtime.universe.Expr[Class[?0(in value <local Test>)]]
where type ?0(in value <local Test>) <: Object
ru.reify(new Object().getClass)
^
This happens because macro expansions are always typechecked against the
return type of their macro definitions instantiated in the context of expandee.
In this case the expected type contains skolems which are incompatible
with wildcards in the type of the expansion.
I tried all the incantations I could think of - without any success.
Luckily I met Martin who pointed me at the same problem solved in adapt
(see the diff w.r.t Typers.scala).
|
|\ \ \ \
| |_|_|/
|/| | | |
SI-6392 wraps non-terms before typecheck/eval
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Wrap non-term arguments of typecheck and eval, so that toolboxes
can work with full-fledged files (except for package declarations).
|
|\ \ \ \
| | | | |
| | | | | |
merges scala.reflect.base into scala.reflect.api
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As the experience has shown, there's no need for a separate layer of reflection
in scala-library.jar. Therefore I'm putting an end to it.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Reification (both tree-based and type-based) should be avoided
before we release 2.10.0-final, since it impairs reflection refactorings
like the upcoming one.
Also the upcoming refactoring moves tag materialization anchors, and we
have to add them to fast track in advance, so that they are treated as
macros later.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
NameType is introduced in base.StandardNames#NamesBase to abstract away the
difference between term names and type names in order to encode common names
such as EMPTY or WILDCARD.
Flavor-specific name repositories, such as TermNames and TypeNames are supposed
to override NameType fixing it to correspondingly TermName or TypeName.
Unfortunately I completely overlooked this and as a result some standard names
were typed with insufficient precision, e.g. This(tpnme.EMPTY) didn't work.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Introduced by uncurry - therefore it can be seen
neither by macros, nor by runtime reflection.
Despite never being pickled, ArrayValue is supported by unpickler
so I couldn't move it exclusively to scala-compiler.jar.
Figuring out the mysterious reason for pickling ArrayValue is left
to future work.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Removed many @inline annotations and final modifiers.
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It is my belief that these @inlines and finals landed between
unhelpful and harmful. I am sure this will be disputed in some
cases. It's too much and too difficult to measure except in the
aggregate unless we have specific @inline sites to discuss.
I don't know upon whom the burden of proof lies. I think we
should err on the side given here, since there is no evidence
of any consistent rationale being applied and it is easy to
verify the negative impact scala compiler inlining can have on
hotspot's far more sophisticated inlining.
|
|\ \ \ \
| |_|_|/
|/| | | |
Rank based take/drop/slice
|
| | | |
| | | |
| | | |
| | | | |
Addresses code review feedback by @axel22.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Tree navigation based on node rank is faster than using compare
method. rank is simply count(tree.left) + 1.
|
|\ \ \ \
| |_|_|/
|/| | | |
Fixes SI-6354: improved error messages for Dynamic signature mismatches.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If an error occurs afer a Dynamic rewriting, augment the error message
with the rewritten tree and a hint to check the Dynamic method
signature.
|
|\ \ \ \
| | | | |
| | | | | |
improved reflection documentation
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
SI-6287 fixes synthetic symbol clashes in toolbox
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Apparently synthetic classes like $anonfun$1 have two properties:
1) Their names are generated using a counter unique to a compilation unit
2) After flatten they levitate to the nearest enclosing package
As a result if we use an empty package to wrap toolbox codegen,
then this package will soon be overflown by $anonfun$1 symbols, because:
1) New codegen session = new compilation unit = new counter which starts at 0
2) New codegen session = new anon funs that end up as children of empty package
Creating a freshly named package for each codegen session fixed the problem.
Now anonfuns from different sessions end up with different parents.
|
|\ \ \ \
| | | | |
| | | | | |
clarify caveats of App trait
|
| | |/ /
| |/| | |
|
|\ \ \ \
| | | | |
| | | | | |
Scala reflection now supports Java CRTP
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Enum members are static and, therefore, they need to be looked up in
classSymbol(<enum>).companionModule, rather than in classSymbol(<enum>).
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Because of using plain ExistentialType factory of a case class
typeToScala sometimes returned existentials with empty quantifieds.
Changing ExistentialType to newExistentialType, which simply returns
the underlying types if params are empty, fixed the problem.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Translation of Java types to Scala types has previously been
existentionalizing raw types of ParameterizedType arguments.
As shown in https://issues.scala-lang.org/browse/SI-6374
this leads to cyclic reference errors. If you wonder about the
mechanism of the error, take a look at the comments to the
aforementioned issue - there's a detailed explanation.
However calling rawToExistential is completely unnecessary, because
existential parameters of the results are immediately discarded,
and only prefix and symbol are used later on (which means that
existential extrapolation performed by rawToExistential also doesn't
after the result).
Finding out this was tough, but the rest was a piece of cake.
Getting rid of the call to rawToExistential when translating ParameterizedType
fixed the problem.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5767 fix + protecting public FlatHashMap API
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
As discussed in https://groups.google.com/forum/?pli=1#!topic/scala-internals/1yABM30POS0
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- `LinkedHashSet` implementation moved from `FlatHashTable` to `HashTable`
- `remove` time reduced from O(n) to O(1)
- `diff` time reduced from O(n^2) to O(n)
- A bit of refactoring in `HashTable` serialization code
- Putting an element into hash map now avoids double hash code/hash index
calculation (see `HashTable#findOrAddEntry`)
- bugfix: compiler/LambdaLift occasionally breaks LinkedHashSet integrity
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
Revert `@static` annotation
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It's a follow-up commit on 4bfcadabae7663e4329f5a4b21a9368477a7e3e3.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit 892ee3df93a10ffe24fb11b37ad7c3a9cb93d5de with
exception of keeping `@static` annotation in the library so we
can deploy a new starr that does not depend on it before removing
it completely.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
src/compiler/scala/tools/nsc/transform/CleanUp.scala
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit 227239018b38ab7218ee6b30493c9c8e1836c8c9.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit 5a8dfad583b825158cf0abdae5d73a4a7f8cd997.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit faa114e2fb6003031efa2cdd56a32a3c44aa71fb.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit 373f22a2022519ab894c1ea77460e6460d7c2ee4.
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This reverts commit cb393fcbe35d0a871f23189d791b44be1b826ed2.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5692 better error message
|