| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we sometimes ended up forcing a companion class symbol from
a previous run or from the classpath which lead to weird issues like in
`false-companion`. Even if we end up not forcing such a symbol, its
presence can still lead to issue: before this commit incremental
compilation of `dotty-compiler-bootstrapped` was broken because we
recorded a false dependency on the non-bootstrapped `dotty-compiler`
jar.
The added test is currently marked pending because it does not work with
JUnit (which doesn't handle separate compilation), only partest. I
didn't managed to get it to work right, and this won't be necessary once
our testing framework is overhauled by
https://github.com/lampepfl/dotty/pull/2125 anyway, so I'll just have to
remember to enable this test afterwards.
|
|\
| |
| | |
Fix position of errors in Inliner TreeTypeMap
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When typechecking
class A {
C.super.foo()
}
If C isn't an enclosing class, the compiler was throwing because of an
unguarded pattern match.
Fix the issue by checking for ErrorType.
Tested:
Verified that the example above no longer throws.
Added a test.
|
|/
|
|
|
|
|
|
|
| |
As part of https://github.com/lampepfl/dotty/issues/1589, use the
new error message for static super references where the qualifier
isn't a parent of the class.
Tested:
Added unit test.
|
| |
|
|\
| |
| | |
Allow inter-parameter dependencies
|
| | |
|
| | |
|
| |
| |
| |
| | |
Take parameter dependencies into account when typechecking arguments.
|
| |
| |
| |
| |
| | |
To allow for dependencies between method type parameters, construct MethodTypes
from a closure that maps the currently constructed MethodType to its parameter types.
|
|\ \
| |/
|/| |
Fix #2077: Optimization of constant conditionals
|
| |
| |
| |
| |
| | |
Move fixed logic to FirstTransform, where the other constant
folding operations are also done.
|
|/
|
|
|
| |
This fix is inspired by 6c91684, but I couldn't tell you why it works
exactly, it's just something I tried.
|
|
|
|
|
|
|
| |
Before this commit, ParSetLike compiled fine as part of compileStdLib
but crashed when compiled by itself because we tried to force a LazyRef
while forcing the same LazyRef. This commit fixes this by being slightly
more lazy where it matters.
|
|\
| |
| | |
Fix #2066: Don't qualify private members in SelectionProto's...
|
| |
| |
| |
| |
| | |
Now we never match `? { name: T }` with types that
have only a private `name` member. This is what scalac does, too.
|
| |
| |
| |
| | |
... unless they would be accessible in the given context.
|
|\ \
| | |
| | | |
Fix #360: Improve avoidance algorithm
|
| | |
| | |
| | |
| | | |
No more try-again business necessary.
|
| |/
| |
| |
| |
| |
| | |
The essential change is that we do not throw away more
precise info of the avoided type if the expected type
is fully defined.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If A method like:
override def foo(x: Object*)
overrides a Java method, it needs to be rewritten as:
def foo(x: Seq[Object])
override def foo(x: Array[Object]): Object = foo(Predef.wrapRefArray(x))
This should be handled by ElimRepeated but there were two bugs:
- `addVarArgsBridge` was called at phase `thisTransformer.next`, this is
too late to create the bridge since `T*` has already been rewritten as
`Seq[T]`
- The original method symbol needs to have the `override` flag dropped,
since it doesn't override anything.
Furthermore, RefChecks had to be moved after ElimRepeated, otherwise the
testcase would fail the overriding checks.
|
|\
| |
| | |
Fix type inference for HLists and HMaps
|
| |
| |
| |
| |
| | |
Need to use fresh PolyParams instead of WildcardTypes
if constraint is committable.
|
| |
| |
| |
| |
| |
| | |
We approximate dependencies to parameters by Wildcards. This was already
done in one place, is now done in other places as well, instead of doing nothing for
dependent methods.
|
| |
| |
| |
| |
| | |
No reason why we should not - normalize handles implicit
methods just fine. This fixes type errors in test HLists.scala.
|
|\ \
| | |
| | | |
Change "recursive/cyclic definitions needs type" errors to Message
|
| | |
| | |
| | |
| | | |
Fall-back to reporting "overloaded or recursive needs type".
|
| | |
| | |
| | |
| | |
| | |
| | | |
Split error messages for recursive method and overloaded method needs type into two (but
did not solve the analysis which to show).
Make CyclicReference type error construct corresponding error message.
|
| |\|
| | |
| | |
| | | |
ennru_RecursiveNeedsType
|
| | | |
|
|\ \ \
| | | |
| | | | |
Disallow subtypes of Function1 acting as implicit conversions
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Now only Scala2 mode treats Function1's as implicit conversions. Instead we introduce
a new subclass ImplicitConverter of Function1, instances of which are turned into
implicit conversions.
|
| | | |
| | | |
| | | |
| | | | |
I introduced an error in the refactoring two commits ago.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The new test `falseView.scala` shows the problem. We might create
an implicit value of some type that happens to be a subtype of Function1.
We might now expect that this gives us an implicit conversion, this
is most often unintended and surprising.
See the comment in Implicits#discardForView for a discussion why
we picked the particular scheme implemented here.
|
|\ \ \ \
| | | | |
| | | | | |
support merging companion objects in expanded trees
|
| | | | | |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previous implementation is problematic when there are multiple
transforms before typer:
1. There might be objects needing merging that only exist in the
expanded trees, which cannot be handled by the previous algorithm.
2. There may be companion object and class defined only in the
expanded trees, the previous algorithm doesn't create links for them.
This PR simplifies the companion object merging logic and
fixes the problems above.
In fact, this PR supports multiple pre-typer transform during expansion.
The protocol is that the expansion of a MemberDef is either a flattened
thicket or a non-thicket tree.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
It's hard to predict for defKind all the desugarings that can be
applied to a definition. Better to do it once the desugarings have been
applied. NoInit and PureInterface are both tested only after Typer,
so it's OK to delay their initialization until regular Typer.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Drop the [type T] syntax, and what's associated to make it work.
Motivation: It's an alternative way of doing things for which there seems
to be little need. The implementation was provisional and bitrotted during
the various iterations to introduce higher-kinded types. So in the end the
complxity-cost for language and compiler was not worth the added benefit
that [type T] parameters provide.
Noe that we still accept _named arguments_ [A = T] in expressions; these are useful
for specifying some parameters and letting others be inferred.
|
|\ \ \
| | | |
| | | | |
Fix #2030: Don't chain implicit conversions
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When inferring a view, we are not allowed to use another
implicit conversion to adapt its result. Fixing this revealed
another problem where we have to re-enable implicit conversions
when pre-typing arguments in overloading resolution.
|
| |_|/
|/| | |
|
|/ / |
|
|\ \
| |/
|/| |
Treat implicit by-name arguments as lazy values
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With the previous rules, the two test cases produce a
diverging implicit expansion. We avoid this by creating
for every implicit by-name argument of type T a lazy implicit
value of the same type. The implicit value is visible for all
nested implicit searches of by-name arguments. That way,
we tie the knot and obtain a recursive lazy value instead of
a diverging expansion.
|
|\ \
| | |
| | | |
Better error messages for missing type of recursive definitions
|