| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An object in a subclass would silently override an inherited
method, then throw a CCE at runtime. I blamed this on matchesType
and altered it accordingly. There's a pretty extensive test case
which reflects my expectations. Review by @odersky please.
Closes SI-5429.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The crickets at http://www.scala-lang.org/node/11901 were in
unanimous agreement that I should proceed as suggested.
- No arguments to @specialize gets you 10/10, not 9/10
- Fixed bugs in AnyRef specialization revealed by trying to use it
- Specialized Function1 on AnyRef.
- Changed AnyRef specialization to use OBJECT_TAG, not TVAR_TAG.
- Deprecated SpecializableCompanion in favor of Specializable,
which has the virtue of being public so it can be referenced
from outside the library.
- Cooked up mechanism to group specializable types so we don't
have to repeat ourselves quite so much, and create a few groups
for illustrative purposes. I'm not too serious about those names
but I used up all my name-thinking-up brain for the day.
- Updated genprod and friends since I had to regenerate Function1.
- Put tests for a bunch of remaining specialization bugs in pending.
Closes SI-4740, SI-4770, SI-5267.
|
| | |
|
| |
| |
| |
| | |
If this looks hacky, that's because it is.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Closes SI-5446.
I am morally certain that fixes of this nature could be
performed by someone who has logged fewer than ten thousand
hours with the compiler.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why is calling the error function not enough to register the error, why
does "setError(tree)" have to be called as well? That was the cause of
this particular stackoverflow. In ContextErrors I see lots of methods
which call setError and lots more which do not, and frankly it's all
pretty terrifying.
There is zero documentation attached to setError. Maybe there's an
explanation somewhere I'm not seeing.
Review by @hubertp.
|
| |
| |
| |
| |
| | |
Fix for trait/impl renaming in 5cbd7d06eb was incomplete.
Looks more complete now.
|
| |
| |
| |
| | |
Some day, outlawed!
|
| |
| |
| |
| | |
Review by @scalamacros.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Direct compiler internals testing. It's really easy, you should probably
use it about 1000 times each. Look at the test:
run/existentials-in-compiler.scala
The checkfile contains the (string representations of the) actual
existentials from the compiler to make sure they correspond properly to
the ones in the source.
Existentials were being printed with wildcards too freely; this has been
tightened up.
|
|\ \ \
| | | |
| | | |
| | | | |
'scalamacros/pullrequest/5229' into develop
|
| |/ / |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Originally we thought that macros declared inside objects should not
provide _this to their bodies.
However, it: 1) contradicts vanilla Scala rules, according to which
both class and object methods can use this, 2) imposes unnecessary
burden on macro developers without providing any conveniences to us.
Review by @odersky.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Annotations are now supported by the reifier:
* AnnotationInfos from symbols get transformed back into mods.
* AnnotatedTypes are retained and are reified along with AnnotationInfos.
Reification is no magic, and reification of annotations especially:
* Annotations cannot refer to symbols defined inside the quasiquote.
This restriction is due to the fact that we need to erase locally defined
symbols before reifying to make subsequent reflective compilations succeed.
However, while doing that, we also need to make sure that we don't make
resulting ASTs non-compilable by removing essential information.
This is tricky, and it more or less works for TypeTrees, but
not for annotations that can contain arbitrary ASTs.
For more details look into the comments to Reifiers.scala.
* Classfile annotations that contain array arguments and are applied to types,
i.e. the ones that generate AnnotatedTypes, cannot be reified.
This is because of limitations of manifest infrastructure.
Typechecking "Array(mirror.LiteralAnnotArg(...))" would require the compiler
to produce a manifest for a path-dependent type, which cannot be done now.
Review by @odersky.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
At some point in the past, trying to prevent deprection warnings from
being issue in triplicate in the repl, I suppressed too much output,
leading to a class of breakdowns where the failure would be swallowed
completely. This went on for far too long. The deprecation warnings
are back in triplicate for the moment, but the repl should now be less
"strong, silent type" and more emo.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
What's improbable about 29f933b60 is that a good chunk of the commit
exists only so you can pass "mods" to the DefDef constructor. And then
the body isn't updated to use it, the parameter dies on the vine. That
was five years ago.
I logged when mods didn't match Modifiers(sym.flags) and there were
a bunch of differences, but I didn't see any interesting behavior
emerging. Still, I bet something changed somewhere (hopefully in the
fixy direction.)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There is a window of danger when multiple related elements are
being typed where something which is conceptually one thing can
slip into two things, and those two things can be incompatible
with one another. Less mysteriously, c478eb770d fixed this:
def f = { object Bob ; Bob } ; val g = f
But, it did not fix this:
def f = { case class Bob() ; Bob } ; val g = f
See test case pos/existentials-harmful.scala for an "in the wild"
code example fixed by this commit.
The root of the problem was that the getter and the field would each
independently derive the same existential type to describe Bob, but
those existentials were not the same as one another.
This has been the most elusive bug I have ever fixed. I want to cry when
I think of how much time I've put into it over the past half decade or
so. Unfortunately the way the repl works it is particularly good at
eliciting those grotesque found/required error messages and so I was
never able to let the thing go.
There is still a cosmetic issue (from the last commit really) where
compound types wind up with repeated parents.
Closes SI-1195, SI-1201.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When performing an existential transform, the bounds produced by the
hidden symbols may contain references to the hidden symbols, but these
references were not accounted for. This was at the root of some bad
behavior with existentials.
If you've ever seen a message like this:
<console>:8: error: type mismatch;
found : B(in value res0) where type B(in value res0) <: A with ScalaObject
required: B(in value res0) forSome { type B(in value res0) <: A with ScalaObject; type A <: Object with ScalaObject }
...then you know what I mean.
Closes SI-4171, not quite yet on SI-1195, SI-1201.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Macro implementations now get type arguments as TypeTrees, not Types.
Keeping the situation with AnnotationInfos in mind, I decided to
go for the most future-proof solution. Another argument for this decision
is that we will most likely have to support untyped macros.
Review by @odersky.
|
|/ / |
|
| | | |
| \ | |
|\ \ \
| | | |
| | | |
| | | | |
'scalamacros/pullrequest/removecodedotscala' and 'scalamacros/pullrequest/macrodoc' into develop
|
| |/ /
|/| | |
|
|/ /
| |
| |
| | |
That was preventing the compiler API scaladoc from building
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
From now on, the usecases inherit the comments from their parents, such
as the explanation and the annotations: @param, @tparam, @return, etc.
An example of usecase comment inheritance is:
/**
* The test function tests the parameter param for ...
*
* @param theParam the implicit parameter to be tested for ...
* @return the result of the test
*
*
*
* @usecase def test(): Bool
*
* The test function tests the parameter taken implicitly from scope.
* Example: `test()`
*
* @return the result of the test for the current scope
*
*
*
* @usecase def test(theParam: SomeType): Bool
*
* This takes the explicit value passed.
* Example: `test(3)`
*
* @param theParam the explicit parameter to be tested for ...
*/
def test(implicit theParam: SomeType): Bool
Notice both usecases override the explanation with their own examples.
The first usecase also overrides the "@return" annotation while the 2nd
usecase overrides the "@param theParam" annotation. If they didn't
override the explanations and annotations, they would inherit the
values from the actual implementation, def test(implicit ...)
This will be followed by @inheritdoc, which enables more fine-grained
control over comment inheritance. The full explanation of using comment
inheritance and @inheritdoc and their interaction with variables is
given at https://wiki.scala-lang.org/display/SW/Tags+and+Annotations
in the "Comment inheritance" and "Inheritance Example" sections.
|
| | | |
| \ | |
| \ | |
| \ | |
|\ \ \ \
| | | | |
| | | | |
| | | | | |
'greedy/auto-fetch-jars', 'scalamacros/pullrequest/assorted' and 'VladUreche/feature/scaladoc-nofail' into develop
|
| | |/ /
| |/| |
| | | |
| | | |
| | | | |
To use it, we need to update starr and then add nofail="yes" to the
build.xml scaladoc tasks.
|
| |/ /
| | |
| | |
| | |
| | | |
Multiple fixes that have been accumulated during my investigations of 5273.
Too heterogeneous to describe here, too minor to split into changesets.
|
| | |
| | |
| | |
| | | |
This reverts commit e34098b7f6e37420198fa5c7c2820d0443b46cc4.
|
| | |
| | |
| | |
| | | |
This reverts commit 7946ac410ad74894cd0eb6dfd29447f173911b99.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In the pursuit of simplicity and consistency.
- Method names like getType, getClass, and getValue are far too ambiguous,
both internally and especially with java reflection names. Methods which
accept or return scala symbols should not refer to them as "classes" in
the reflection library. (We can live with the FooClass convention for naming
the well-known symbols, it's names like "getClass" and "classToType" which
are needlessly conflationary.)
- Meaningless names like "subst" have to be expanded.
- We should hew closely to the terms which are used by scala programmers
wherever possible, thus using "thisType" to mean "C.this" can only beget confusion,
given that "thisType" doesn't mean "this.type" but what is normally called
the "self type."
- It's either "enclosing" or "encl", not both, and similar consistency issues.
- Eliminated getAnnotations.
- Removed what I could get away with from the API; would like to push
those which are presently justified as being "required for LiftCode" out of the core.
- Changed a number of AnyRefs to Any both on general principles and because
before long it may actually matter.
- There are !!!s scattered all over this commit, mostly where I think
the name could be better.
- I think we should standardize on method names like "vmSignature, vmClass" etc.
when we are talking about jvm (and ostensibly other vm) things.
There are a bunch more places to make this distinction clear (e.g.
Symbol's javaBinaryName, etc.)
- There is a lot more I want to do on this and I don't know where the
time will come from to do it.
Review by @odersky, @scalamacros.
|
| | |
| | |
| | |
| | |
| | | |
Couldn't live with a scala.Enumeration being a permanent
fixture in the reflection library. Rolled it by hand.
|
| | | | |
| | \ | |
| | \ | |
| | \ | |
| | \ | |
| | \ | |
| |\ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | | |
'scalamacros/pullrequest/5334', 'scalamacros/pullrequest/5272' and 'VladUreche/issue/5287-cleanup' into develop
|
| |_|_|_|/ /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
From now on, the usecases inherit the comments from their parents, such
as the explanation and the annotations: @param, @tparam, @return, etc.
An example of usecase comment inheritance is:
/**
* The test function tests the parameter param for ...
*
* @param theParam the implicit parameter to be tested for ...
* @return the result of the test
*
*
*
* @usecase def test(): Bool
*
* The test function tests the parameter taken implicitly from scope.
* Example: `test()`
*
* @return the result of the test for the current scope
*
*
*
* @usecase def test(theParam: SomeType): Bool
*
* This takes the explicit value passed.
* Example: `test(3)`
*
* @param theParam the explicit parameter to be tested for ...
*/
def test(implicit theParam: SomeType): Bool
Notice both usecases override the explanation with their own examples.
The first usecase also overrides the "@return" annotation while the 2nd
usecase overrides the "@param theParam" annotation. If they didn't
override the explanations and annotations, they would inherit the
values from the actual implementation, def test(implicit ...)
This will be followed by @inheritdoc, which enables more fine-grained
control over comment inheritance. The full explanation of using comment
inheritance and @inheritdoc and their interaction with variables is
given at https://wiki.scala-lang.org/display/SW/Tags+and+Annotations
in the "Comment inheritance" and "Inheritance Example" sections.
|
| | | |/ / |
|
| |/ / /
|/| | | |
|
| |\ \ \
| | |/ /
| |/| | |
|
| |/ /
|/| | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Major cleanup of reification:
* LiftCode phase has been removed
* Code has been deprecated and will be removed as we roll a new starr
* Logic related to type-directed lifting has been purged
scala.reflect.macro.Context#reify now provides the same services
as LiftCode provided (except that it returns Tree, not Code).
For testing purposes, I've retained the oh-so-convenient automagic lift.
test/files/codelib/code.jar now hosts Code.lift reimplemented in a macro,
so that the tests can continue working as if nothing has happened.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In a stunningly unusual demonstration of farsightedness,
I was able to generate these changes only by running:
scala scala.tools.nsc.util.FlagsUtilCompiler
With this much time in between runs:
-// Generated by mkFlagsTable() at Mon Oct 11 10:01:09 PDT 2010
+// Generated by mkFlagsTable() at Thu Feb 02 20:31:52 PST 2012
|
| | |
|
| | |
|
|\ \ |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
determine match strategy by typing `__match`
factored out the interface to generate code in this monad, cleaned up codegen a bit
no longer solving a context bound to determine the match strategy and the monad's type constructor
it's too expensive
don't consider implicits looking for __match
implicit search causes HUGE slowdowns -- now the overhead is about 4% compared to just assuming there's no __match in scope
to support virtualization&staging, we use the type of `__match.one` as the prototype for how to wrap "pure" types and types "in the monad"
pure types T are wrapped as P[T], and T goes into the monad as M[T], if one is defined as:
def one[T](x: P[T]): M[T]
for staging, P will typically be the Rep type constructor, and type M[T] = Rep[Option[T]]
furthermore, naive codegen no longer supplies type information -- type inference will have to work it out
optimized codegen still does, of course, and that's enough since we only bootstrap that way
TODO: improve the test (currently the condition is not represented)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
before, we were mutating treemakers in-place when they were reused
no more mutation, and CSE is now self-contained
interestingly, we were considering all FunTreeMakers as potentially reused,
but only CondTreeMakers ever did anything with that flag
should be clearer now that only those are ever reused
simplified substonly treemaker a bit
overall cleanup to prepare for switching to new-style detection of MatchStrategy
delaying wrapping in function to simplify optimizing codegen logic
|