| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
- allow inline as an alternative to final for vals
(final is retained for backwards compatibility for now)
- allow inline for parameters
- check that rhs of inline value has a constant type
- check that arguments to inline value parameters have constant type
- check that inline members are not deferred
- make inline members effectively final
|
| |
|
|
|
|
|
|
|
| |
Accessors were multiply generated under separate compilation.
To fix this, the resident body of an inlined function is now
the same as the inlined body. Both use accessors where necessary.
Previously, only the inlined body used accessors.
|
|
|
|
|
|
|
| |
`inline` is now a modifier keyword. To keep disruption tolerable,
we still allow `@inline` as an annotation as well. Other uses of
`inline` are supported only under `-language:Scala2` and are rewritten
to identifiers in backticks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Drop @dotty.annotation.inline. This will inline all
@inline marked methods in Scala for which a body is known
(i.e. that are either compiled in the same run or have Tasty
trees available).
Option -Yno-inline suppresses inlining. This is needed for
the moment because some @inline methods access private members
or members that are otherwise inaccessible at the call-site.
Also fixes some problems in Inliner
- make sure type arguments to inline calls re fully defined
- don't forget recursive calls in typeMap
- don't forget positions in treeMap
- drop dead code dealing with outer.
|
| |
|
|
|
|
|
| |
pos/power inlines with alomst no extraneous boilerplate.
neg/power gives an error that maximal numbers of inlines was exceeded.
|
|
|
|
|
| |
To be done: outer accessors
To be done: error positions
|
|
|
|
|
|
| |
`apply` nodes should not be inserted in the result parts
of a block, if-then-else, match, or try. Instead they should
be added to the surrounding statement.
|
|\
| |
| | |
Fixes for scala.Dynamic
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|\
| |
| | |
Fix #1444: Pass implicits to parameterless traits if needed
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
If a super trait is given as a type (i.e. no argument list), implicit args were
not passed. This is fixed now. Also, we now check for parameterized traits lacking
type arguments in Typer instead of in Mixin.
Fixes #1444.
|
| |
| |
| |
| | |
Needed because the test is also run in neg wihtout command line option.
|
|/
|
|
|
|
|
|
|
|
| |
There's a nasty interaction with auto-tupling and trying to insert an implicit
on the qualifier of a call. If the original call fails, we need to "undo" any
auto-tupling decisions in calls where an implicit is inserted on the qualifier.
Also: Needed to fix canAutoTuple test so that Scala2 feature is checked instead of dotty's.
Also: Drop features in dotty.language that duplicate those in scala.language.
|
|
|
|
| |
Turn assertion into test. Without this, neg/tcpoly_overloaded.scala fails.
|
|
|
|
|
|
| |
Roll `sm` and `i` into one interpolator (also called `i`)
Evolve `d` to `em` interpolator (for error messages)
New interpolator `ex` with more explanations, replaces disambiguation.
|
|
|
|
| |
Remove debug info from error message.
|
|
|
|
|
|
|
|
| |
Interpolating typevars that appear co- or contra-variantly in a type
is a cleanup measure - it helps keep the constraint set small. However,
if there are uneported errors, some of these errors might report on
unsatisfiable constraints for these type variables. In that case, instantiating
the type variables risks being confusing.
|
| |
|
|\
| |
| | |
Fix typing of match expressions
|
| | |
|
| |
| |
| |
| | |
Also fix reviewers comments about `firstParent`
|
| |
| |
| |
| |
| | |
Allow matches between unapply types and selector type where a possible
overlap might exist.
|
|\ \
| |/
|/| |
Changes to overloading
|
| |
| |
| |
| |
| |
| | |
Fix #1381: Overloading is now changed so that we first try without implicit searches.
Only if that leaves no applicable alternatives we try again with implicit search turned on.
This also fixes test case t2660, which got moved from neg to pos.
|
|\ \
| | |
| | | |
Add scala.Dynamic support.
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| |_|/
|/| | |
Implement -Yno-predef and -Yno-imports
|
| | |
| | |
| | |
| | |
| | |
| | | |
* Implement flags -Yno-predef and -Yno-imports
* Add unit tests for both
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Enable checking of bounds when comparing type lambdas. This invalidates
a pattern used in t2994 and potentially other code, where a bound [X] -> Any
is used as a template that is a legal supertype of all other bounds. The old
behavior is still available under language:Scala2.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Previous logic could only handle classes as constructors.
Also, address other reviewers comments.
|
| | | |
|
| | |
| | |
| | |
| | | |
Allow hk type parameters to be higher kinded themselves.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When applying a type alias of a type lambda, keep the original
application instead of reducing. But reduce anyway if
- the reduced type is an application where the type
constructor has the same kind as the original type constructor, or
- some of the arguments are wildcards.
|
| | |
| | |
| | |
| | |
| | | |
Allow definition of types in refinements that do not appear
in parent type.
|
| | |
| | |
| | |
| | |
| | | |
Allows partially instantiated types as type constrictors when inferring higher-kinded
types.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We cannot handle such types in general. So we now check that a hk application
C[args]
where some of the arguments are wildcards does not have as a supertype
a hk application
([X] -> B)[args]
|
| | |
| | |
| | |
| | | |
Also, fix error counts in tests for new hk scheme.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- compileMixed failed because there was a cycle between immutable.Seq (compiled) and
parallel.ParSeq (loaded from classfile). Inspection of the completion log (turn completions
Printer on) and the stack trace showed that there's nothing we can do here. The old hk scheme
did not go into the cycle because it did not force an unrelated type. I believe with enough
tweaking we would also hva egotten a cycle in the old hk scheme.
The test is "fixed" by adding parallel.ParSeq to the files to compile.
- Disable named parameter tests
Those tests do not work yet with the revised hk scheme.
Before trying to fix this, we should first decide what parts of
named parameters should be kept.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We would like to change from a scheme where eta-expansion was
prototype driven to one where unapplied parameterized types are always
eta expanded. The reason is that we might miss some eta expansions due
to cyclic references.
run/colltest4
is an exmaple. Here, we missed an eta expansion in the type of Iterator.
The class definition is:
trait Iterable[+A] extends IterableOnce[A] with FromIterable[Iterable] {
We'd expect that the second parent would expand to
FromIterable[[X0] -> Iterable[X0]]
But we miss the expansion because at the time we complete Iterable we have not
completed FromIterable yet. In fact this happens in both the old and the new hk scheme.
But in the old scheme we did not notice the error whereas in the new scheme we
get an error in PostTyper that the type Iterable does not conform to its bound
`[X0] -> Iterable[X0]`.
With this commit, we change the scheme, so that eta-expansion depends on the
type parameters of a type itself, instead of the expected type.
We should investigate whether we can do a similar change for Scala2 classloading.
Check kinds of type parameters
Also, do not allow a hk type if the bound is a * type.
|