| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Upgrades the way that macro defs are compiled by factoring out most of
the logic in typedMacroBody and related errors in ContextErrors into an
standalone cake. This leads to tighter cohesion and better code reuse
as the cake is isolated from the rest of the compiler and is much easier
to evolve than just a method body.
Increased convenience of coding macro compilation allowed me to further
clarify the implementation of the macro engine (e.g. take a look at
Validators.scala) and to easily implement additional features, namely:
1) Parameters and return type of macro implementations can now be plain
c.Tree's instead of previously mandatory c.Expr's. This makes macros more
lightweight as there are a lot of situations when one doesn't need to
splice macro params (the only motivation to use exprs over trees). Also
as we're on the verge of having quasiquotes in trunk, there soon will be
no reason to use exprs at all, since quasiquotes can splice everything.
2) Macro implementations can now be defined in bundles, standalone cakes
built around a macro context: http://docs.scala-lang.org/overviews/macros/bundles.html.
This further reduces boilerplate by simplifying implementations complex
macros due to the fact that macro programmers no longer need to play
path-dependent games to use helpers.
|
|
|
|
|
|
|
| |
putting in a nutshell, this patch:
* condenses some macro-XXX-a/b/c/... bundles
* renames some tests to prepare for other macro flavors
* introduces some additional tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Macro impl bindings now store more information in signatures.
Previously it was a flattened List[Int] corresponding to flattened paramss,
now it's List[List[Int]] to preserve the lengths of parameter lists.
Also now we distinguish between c.Expr parameters and others.
Previously actual and reference macro signatures were represented as
tuples of vparamss, rets, and sometimes tparams. Now they are all
abstracted behind MacroImplSig.
Finally this patch provides better error messages in cases of
argsc <-> paramsc and argc <-> paramc mismatches.
|
|
|
|
|
|
| |
Otherwise use cases like the one shown in the attached test (trying to
typecheck something, which leads to an ambiguous overload error) will
mysteriously fail compilation.
|
|\
| |
| | |
Print raw types correctly.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The "For convenience, these are usable as stub implementations"
bit has generated surprisingly few angry letters, but I noticed
today it blows it on raw types. Or, used to blow it.
/** As seen from class Sub, the missing signatures are as follows.
* For convenience, these are usable as stub implementations.
* (First one before this commitw as 'def raw(x$1: M_1)'
*/
def raw(x$1: M_1[_ <: String]): Unit = ???
def raw(x$1: Any): Unit = ???
|
|\ \
| |/
|/| |
SI-7469 Remove deprecated elements in Java{Conversions,Converters}
|
| | |
|
|\ \
| | |
| | | |
SI-7003 Partest redirects stderr to log file
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Partest will also read files/filters and files/kind/filters for
filter expressions (one per line, trimmed, leading #comments)
which are taken as regexes.
A test/files/filters is provided which attempts to quell HotSpot
warnings; the test for this commit requires it.
The elided lines can be revealed using the lemon juice of verbosity:
apm@mara:~/projects/snytt/test$ ./partest --verbose --show-diff files/run/t7198.scala
[snip]
>>>>> Transcripts from failed tests >>>>>
> partest files/run/t7198.scala
% scalac t7198.scala
[snip]
% filtering t7198-run.log
--Over the moon
--Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 28).
The filtering operation is part of the transcript, which is printed on failure.
No attempt is made to be clever about not slurping the filters file a thousand times.
Previous literal patterns had to be updated because there's parens in them thar strings.
Future feature: pattern aliases, define once globally and invoke in test filters.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some scalac output is on stderr, and it's useful to see that
in the log file, especially for debugging.
Adds a line filter for logs, specified as "filter: pattern"
in the test source.
Backslashes are made forward only when detected as paths.
Test alignments:
Deprecations which do not pertain to the system under test
are corrected in the obvious way.
When testing deprecated API, suppress warnings by deprecating
the Test object.
Check files are updated with useful true warnings, instead of
running under -nowarn.
Language feature imports as required, instead of running under -language.
Language feature not required, such as casual use of postfix.
Heed useful warning.
Ignore broken warnings. (Rarely, -nowarn.)
Inliner warnings pop up under -optimise only, so for now, just
filter them out where they occur.
Debug output from the test required an update.
|
|\ \
| |/
|/| |
Concision contribution.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have lots of core classes for which we need not go through
the symbol to get the type:
ObjectClass.tpe -> ObjectTpe
AnyClass.tpe -> AnyTpe
I updated everything to use the concise/direct version,
and eliminated a bunch of noise where places were calling
typeConstructor, erasedTypeRef, and other different-seeming methods
only to always wind up with the same type they would have received
from sym.tpe. There's only one Object type, before or after erasure,
with or without type arguments.
Calls to typeConstructor were especially damaging because (see
previous commit) it had a tendency to cache a different type than
the type one would find via other means. The two types would
compare =:=, but possibly not == and definitely not eq. (I still
don't understand what == is expected to do with types.)
|
|\ \
| | |
| | | |
SI-7499 Additional test case for SI-7319
|
| | |
| | |
| | |
| | | |
From a duplicate ticket.
|
|\ \ \
| |_|/
|/| | |
SI-3425 erasure crash with refinement members.
|
| | |
| | |
| | |
| | | |
Probably overshot the mark a little.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Checking that a refinement class symbol does not override
any symbols does mean it will have to be invoke reflectively;
but the converse is not true. It can override other symbols
and still have to be called reflectively, because the
overridden symbols may also be defined in refinement classes.
scala> class Foo { type R1 <: { def x: Any } ; type R2 <: R1 { def x: Int } }
defined class Foo
scala> typeOf[Foo].member(TypeName("R2")).info.member("x": TermName).overrideChain
res1: List[$r.intp.global.Symbol] = List(method x, method x)
scala> res1 filterNot (_.owner.isRefinementClass)
res2: List[$r.intp.global.Symbol] = List()
And checking that "owner.info decl name == this" only works if
name is not overloaded.
So the logic is all in "isOnlyRefinementMember" now, and
let's hope that suffices for a while.
|
|\ \
| |/
|/| |
SI-7436 Varargs awareness for super param aliasing.
|
| |
| |
| |
| |
| |
| |
| | |
Don't consider a super class parameter accessor to be
an alias if it is a repeated. Parameter aliases are used
to avoid retaining redundant fields in the subclass; but
that optimization is out of the question here.
|
|\ \
| | |
| | | |
Toward more organized typer state.
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | | |
* origin/master:
An attempt to make tests deterministic.
SI-7427 stop crashing under -Ydebug.
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* commit 'd93826f278':
Incorporated reviewer feedback.
Incorporated reviewer feedback.
Refactored stabilize.
Eliminated HKmode.
Eliminated RETmode.
Eliminated SNDTRYmode.
Started eliminating modes.
Corralling Modes into a smaller pen.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Macros.scala
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| | |\ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* master:
SI-7469 Remove @deprecated scala.util.logging
SI-3943 Test case for already-fixed Java interop bug
Fix formatting for couple of docs in the compiler
SI-7476 Add documentation to GenericTraversableTemplate
SI-7469 Remove @deprecated scala.util.parsing.ast
SI-7469 Remove @deprecated MurmurHash elements
SI-7469 Remove deprecated elements in s.u.parsing.combinator
SI-7469 Make @deprecated elems in scala.concurrent private[scala]
removes duplication in inferImplicitValue
SI-7047 fixes silent for c.inferImplicitXXX
SI-7167 implicit macros decide what is divergence
macroExpandAll is now triggered in all invocations of typed
SI-5923 instantiates targs in deferred macro applications
SI-6406 Restore deprecated API
SI-6039 Harden against irrelevant filesystem details
Limit unnecessary calls to Type#toString.
fix typo in comment
SI-7432 add testcases
SI-7432 Range.min should throw NoSuchElementException on empty range
AbstractFile.getDirectory does not return null when outDir is "."
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Attempting to reduce the frequency of low-level operations
with modes. I mean stuff like this:
if ((mode & (EXPRmode | LHSmode)) == EXPRmode)
THey don't make those ten line boolean guards any easier
to understand. Hopefully this will lead us toward eliminating
some of the modes entirely, or at least better isolating
their logic rather than having it interspersed at arbitrary
points throughout the typer.
Modes are in their entirety a leaked implementation detail.
Typing a tree requires a tree and optionally an expected type.
It shouldn't require a bucket of state bits. In subsequent
commits I will start eliminating them.
This commit also breaks adapt down into more digestible chunks.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
SI-7494 Each plugin must only be instantiated once.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Exploit SI-6446 fix to move old pending tests for plugins to the
active pool.
Also, nuance the partest runner to allow the compiler to crash
with a FatalError if a check file is present.
Some of the plugin tests make phase assembly throw.
One of the legacy tests was moved back to pending:
There seems to be a race for who shall be deemed truly dependent.
Back to pending for you!
apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/
Selected 1 tests drawn from specified tests
> starting 1 test in neg
ok 1 - neg/t7494-cyclic-dependency
1/1 passed (elapsed time: 00:00:04)
Test Run PASSED
apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/
Selected 1 tests drawn from specified tests
> starting 1 test in neg
!! 1 - neg/t7494-cyclic-dependency [output differs]
> 0/1 passed, 1 failed in neg
>>>>> Transcripts from failed tests >>>>>
> partest files/neg/t7494-cyclic-dependency
% scalac t7494-cyclic-dependency/ThePlugin.scala
% scalac t7494-cyclic-dependency/sample_2.scala
error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice!
% diff files/neg/t7494-cyclic-dependency-neg.log files/neg/t7494-cyclic-dependency.check
@@ -1 +1 @@
-error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice!
+error: Cycle in compiler phase dependencies detected, phase cyclicdependency2 reacted twice!
0/1 passed, 1 failed (elapsed time: 00:00:04)
Test Run FAILED
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The nondeterminism presently showing itself in
presentation/implicit-member is a consequence of the
presentation compiler tests relying on details of the
behavior of toString calls. We need to stomp this out,
but it will take a while. Based on the check file
changes enclosed with this commit, this will suffice
for the presentation compiler tests. A broader assault
will have to take place, but not yet.
|
| |/ / / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Change "dumpClassesAndAbort" to "devWarning". You can witness
it happen like so.
% scalac test/files/pos/t7427.scala -Ydebug -Xdev
...
[running phase cleanup on t7427.scala]
[running phase icode on t7427.scala]
warning: !!! PJUMP(method matchEnd4)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
warning: !!! PJUMP(method case6)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
[running phase inliner on t7427.scala]
[running phase inlinehandlers on t7427.scala]
Having now lived with this for months, I have no ambition to
unravel the actual problem, I just want it to stop crashing.
|
|\ \ \ \ \
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Implicits.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
|
| |\ \ \ \
| | | | | |
| | | | | | |
[backport #1727] SI-7359 cyclic nested java class
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The original commit message (from 54a84a36d5):
SI-6548 reflection correctly enters jinners
When completing Java classes, runtime reflection enumerates their
fields, methods, constructors and inner classes, loads them and
enters them into either the instance part (ClassSymbol) or the
static part (ModuleSymbol).
However unlike fields, methods and constructors, inner classes don't
need to be entered explicitly - they are entered implicitly when
being loaded.
This patch fixes the double-enter problem, make sure that enter-on-load
uses the correct owner, and also hardens jclassAsScala against double
enters that can occur in a different scenario.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
What a touchy beast the compiler is.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-1786 incorporate defined bounds in inference
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is a variation on the previous commit which excludes
named type parameters, so this works
def f(x: Class[_]) = x.foo.bar
But this does not:
def f[T](x: Class[T]) = x.foo.bar
This seems undesirable to me, but I offer it in case it makes
the patch more attractive to others.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Also fixes SI-5459.
Look, you don't have to redeclare the bounds, isn't it exciting?
For instance, there are eight places in JavaMirrors with this:
jTypeVariable[_ <: GenericDeclaration]
After this code is in starr, those can look like this:
jTypeVariable[_]
Since TypeVariable's definition looks like this:
interface TypeVariable<D extends GenericDeclaration>
We already know that!
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6488 Interrupt i/o threads on process destroy
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The previous fix uses Thread.stop to stop the threads which
drain outputs, but should do something orderly.
This commit interrupts the threads, which must check isInterrupted
before attempting further i/o.
The reading thread will suppress either the interruption or the
IOException cited in the ticket.
Similarly, i/o handlers must preserve and communicate interrupted
status.
The modest goal of this fix is to ameliorate any stack traces
when the process is destroyed.
The test runs itself as a sample process with output.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Merge v2.10.1-326-g4f8c306 into master
|
| |\ \ \ \ \ \ \ \
| | |_|_|/ / / / /
| |/| | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
================================================================
Merge commit 'v2.10.1-326-g4f8c306' into merge/v2.10.1-326-g4f8c306-to-master
Conflicts:
src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
================================================================
Merge -s ours 4e64a27 ([nomaster commit range])
================================================================
Merge commit '0ae7e55' into merge/v2.10.1-326-g4f8c306-to-master
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Macros.scala
|
| |\ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-7464 allows FieldMirror.set to update vals
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
There's no reason to leave such sentinels in place inside a facility
designed to circumvent usual restrictions of static types / visibility.
|
| |\ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
easy way of writing not implemented macros
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Even though it's easy to mark regular method bodies as stubs (using ???),
there's no simple way of doing the same for macro methods. This patch
fixes the inconvenience.
|
| | |_|_|_|_|/ / / /
| |/| | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Nothing breaks. Why did by-name arguments have this
extra check? What's the difference to a () => T?
The check was added originally in 8414eba.
|
| |\ \ \ \ \ \ \ \ \
| | |/ / / / / / / /
| |/| | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
viktorklang/wip-SI7383-EC-prepare-in-Future-apply-2.10-√
SI-7383 - call ExecutionContext.prepare in Future.apply
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
capturing local context like ThreadLocals and then re-establishing them prior to execution, as per intention of EC.prepare
|
| |\ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
makes sense of implicit macros!
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Despite inferImplicit usually being nice and buffering errors, apparently
it can also throw DivergentImplicit exception. This patch catches it and
only reports it if silent is set to false.
NOTE: we no longer have the DivergentImplicit exception in master,
so this commit only makes sense in 2.10.x.
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
silent = true now throws a TypecheckException even if we don't know why
an implicit search has failed (i.e. if context.hasErrors is false).
NOTE: this commit is a part of a pull request for 2.10.x, which makes sense of
implicit macros. Everything in that pull request is [nomaster] due to one
reason or another. This commit would work equally well in both 2.10.x and
master, but I'm marking it as [nomaster] as well, because I'm anyway going
to resubmit the whole pull request into master soon, so there's no reason
to introduce additional confusion.
|