| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Another level of dispatch based on what trees on can expect
to see during what mode. This should be beneficial for both
performance (smaller methods, fewer type tests) and correctness
(prevent trees from reaching inappropriate typing methods by
construction rather than via ad hoc checks.)
This work also revealed that UnApply trees never reach here,
so I removed typedUnApply as dead code.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Catching an assert and providing beautifully formatted contextual
information is a questionable service if you forget to provide the
error message from the assert.
|
| | |
| | |
| | |
| | |
| | | |
This makes it a lot less error prone and redundant to find the
part you need when unwrapping an UnApply tree.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This exploits the infrastructure developed for checking the
checkability of type patterns to improve pattern type inference,
which suffered from a similar deficit. There was a hack for
SI-2486, the best I could manage at the time I wrote it; that
is replaced with the principled approach.
|
| | |
| | |
| | |
| | |
| | | |
All parents of an intersection type must be checkable for the
type to be checkable.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Because who doesn't want a little positioning in their life.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We should do a lot more of this - it's ridiculously difficult
and error prone to generate code of this kind involving implicits,
type inference, etc. where the same goal is trivially accomplished
by generating a method call and letting the typer work out the
details.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new method is the same as sameMethodAndFieldSignatures, but ignores
generic signatures. This allows for testing methods which receive the same
descriptor but differing generic signatures. In particular, this happens
with value classes, which get a generic signature where a method written
in terms of the underlying values does not.
|
| | |
| | |
| | |
| | | |
Motivated by pattern matcher work, also useful elsewhere.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It's a source of constant peril that sym.tpe on NoSymbol
is fine (it's NoType) but tpe memberType sym on NoSymbol throws
a NSDNHO. The last thing we should be doing is discouraging
people from using memberType in favor of sym.tpe, the latter
being almost always the wrong thing.
|
| | | |
|
| |/
|/| |
|
|\ \
| | |
| | | |
SI-7704 Fix partest's test category selection (again)
|
|/ /
| |
| |
| |
| | |
Looks like multiple, different fixes for this issue managed to break it
again.
|
|\ \
| | |
| | | |
kills introduceTopLevel
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As we've figured out from the practice, introduceTopLevel is seductively
useful but unfortunately not robust, potentially bringing compilation
order problems.
Therefore, as discussed, I'm removing it from the public macro API.
Alternatives are either: 1) delving into internals, or
2) using macro paradise and experimenting with macro annotations:
http://docs.scala-lang.org/overviews/macros/annotations.html.
|
|\ \ \
| | | |
| | | | |
SI-6507 do not call .toString on REPL results when :silent is on.
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Member handlers used to always call .toString on REPL results, even when
:silent was on, which could force evaluation or cause unwanted side
effects.
This forwards the current value of `printResults` to the member
handlers (through Request) for them to decide what to do when the
results must not be printed.
2 handlers now do not return any extraction code when silent:
- ValHandler, so that it doesn't call toString on the val
- Assign, so that it doesn't call toString on the right-hand side
of the assignement.
|
|\ \ \
| | | |
| | | | |
SI-7630 [Avian] Skip test run/repl-javap-outdir-funs on Avian
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
The test fails, because the REPL command reports that no anonfuns were
found. I have spent a considerable amount of time to figure out what's
the issue here with no success.
Skip it for now, so that we don't lose sight of the big picture.
|
|\ \ \
| | | |
| | | | |
SI-7564 [Avian] Whitespace fixes to run/tailcalls.check
|
| | |/
| |/|
| | |
| | |
| | | |
Looks like the differences in the whitespace caused the test to fail
on Avian.
|
|\ \ \
| | | |
| | | | |
SI-7681 Remove DaemonThreadFactory, clean up IMain
|
| | | | |
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
updated SI-7331, SI-6843, SI-7731, parser entry point refactoring, assertThrows utility function
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
1. don't recreate symbol table manually and just let JUnit do it
automatically behind the scenes
2. minor changes to assertThrow's description
3. add one more test case to check that exception's subclasses
are catched too
4. refine rethrow test to ensure that the exception wasn't swallowed
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is achieved in a following way:
1. Similarly to toolbox quasiquotes can go away with wrapping for
parsing purpose after introduction of `parseStats` and `parseRule`
entry points.
2. In case of syntax error quasiquote computes equivalent corresponding
position in the source code with the help of `corrrespondingPosition`
mapper which relies on position data collected into `posMap` during
code generation.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Change toolbox parsing to use `parseStats` parser entry point
instead of current code-wrappign technique that makes positions
much less useful to end users.
There is also no need to create a compiler `Run` for parsing.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit refactors repl to use `parseStats` entry point and
streamlines hacky error handling that was previously used to
encode errors that happen during parsing.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit contains three logical changes:
1. Split `templateStatSeq` into two methods as we need more reliable
parsing of template body alone for new `parseStats` entry point.
2. Add new parser entry point called `parseStats` which is aimed towards
use in tools that require parsing of Scala code that can be written
inside of a template.
Such functionality is required for parsing lines in repl, parsing
code through toolbox, parsing and running scala scripts and lastly
for quasiquotes. All of them are refactored to use this very method
in the next commits.
A new method called `templateStatsCompat` is also added to make this
commit pass the tests but it's a temporary hack that will be removed
in next commit in favor of `parseStats`.
3. Extract out a few methods like `isCaseDefStart`, `expectedMsgTemplate`
and `parseRule`. These are needed to override parser behaviour in
updated quasiquotes parser (see next commits).
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously setPos, pos_=, setType, tpe_= all behaved inconsistently
between each other even though they all represent similar
attributes that cannot be changed on CannotHaveAttrs trees.
In order to simplify handling of such trees in compiler code each
of these fields now supports assignment to its current default
value: NoType for tpe and NoPosition for pos. Such assignments
don't mutate underlying trees.
|
| |/ /
| | |
| | |
| | | |
This is much easier to use than built-in JUnit method-level checks.
|
|\ \ \
| | | |
| | | | |
SI-7715 String inpatternation s"$_" for s"${_}"
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In a pattern,
```
scala> implicit class RX(val sc: StringContext) {
| def rx = sc.parts.mkString("(.+)").r }
defined class RX
scala> "2 by 4" match { case rx"$a by $_" => a }
res0: String = 2
scala> val rx"$_ by $b" = "2 by 4"
b: String = 4
```
|
|\ \ \ \
| | | | |
| | | | | |
SI-7470 implements fundep materialization
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This fix provides implicit macros with an ability to affect type inference
in a more or less sane manner. That's crucial for materialization of
multi-parametric type class instances (e.g. Iso's from shapeless).
Details of the technique can be found in comments.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-7658 Prevent StackOverflowError in ScalaRunTime.stringOf
|
| | | | | | |
|
| | |/ / /
| |/| | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-7704 Fix partest's test category selection
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
... not Unit now.
|