| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Need to pass a current context to be able to find instances of typevars.
|
| |
|
|
|
|
| |
Thus constraining the search space.
|
|
|
|
|
|
| |
1) Selecting from a wildcardtype now gives a wildcard type. Wildcard types are no longer legal as prefixes of NamedTypes.
2) Bound of type variables are proagated into wildcard type approximations.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Need to handle the case of a curried method with result type
(Ts)T
and expected type
Ts => T
|
|
|
|
| |
Previously, such classes just had ProductN as parent, which is not a subtype of AnyRef.
|
|
|
|
| |
in closures.
|
|
|
|
|
| |
We need to take type arguments + value arguments into account when there are several overloaded
alternatives that are all polymorphic and can be instantiated with the type arguments.
|
| |
|
| |
|
|
|
|
| |
This can happen while classParents is set to Nil in Namer#classSig. Any call to baseClasses and superClassBits during that time needs to bypass the cache.
|
| |
|
|
|
|
| |
When called from implicitScope, we formed an AndType with a WildcardType. No problem, except that this broke the AndType assertion. The assertion is not needed for this sepcial case.
|
| |
|
|
|
|
| |
E.g. in privateWithin.
|
|
|
|
| |
Special by-topic printers that can be turned off.
|
|
|
|
| |
When removing logging, it turned out that Coder no longer compiled. The problem was tracked to safeUnderlyingTypeParams which did not force enough.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... and I believe should not compile under Scala2x either. The problem is in line 361 of TreeInfo.scala
methPart(tree) match { ...
Here,
tree: tpd.Tree
methPart: (tree: this.Tree): Tree
So we need to show that
tpd.Tree <: this.Tree
LHS expands to
ast.Tree[Type]
RHS expands to
ast.Tree[T] where T >: Untyped is TreeInfo's type parameter
Since Tree is contravariant, we need to etablish
T <: Type
but I see nothing that could prove this. The Dotty typechecker detected the problem, yet Scala2x's didn't. Need to follow up on why not. For now, adding the necessary constraint to the codebase.
|
|
|
|
| |
The isFullyDefined accumulator will now maximize variables which are contravariant in the type, rather than minimizing them. Fits better in the general scheme and makes a pattern match in TreeInfo go through.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Given
(params) => body
and an expected type
Ts => R
with R fully defined, we use R as the result type of the closure def into which the function is translated.
Note: It would be nice generalize this further to result types which are not fully defined, yet this would complicate things by entangling typing and desugaring.
|
|
|
|
| |
When forceDegree == None, a TypeVar should trigger a false result.
|
|
|
|
| |
... which were introduced when trying to avoid NoSymbol owners.
|
|
|
|
|
|
|
|
|
|
| |
Given a function
(params) => body
If the expected type is Ts => T and T is fully defined, desugar to a closure with given result type T.
Note, it's tempting to generalize this further to non-fully defined result types, but then we cannot do clsoure expansion during unsugaring, and things would get complicated.
|
| |
|
| |
|
| |
|
|
|
|
| |
This triggered an assertion violation in ImplicitSearch. When checking an argument for a method, it's possible that the method parameter is a lower bound, and the argument is incompatible with that lower bound. In this case an implicit conversion towards the variable was searched, which leads to an explosion of the search space (the variable expands to WildcardType, so _every_ implicit is eligible). Better to search for a conversion to the lower bound (or, in fact, and equivalently, the underlying type parameter) instead.
|
| |
|
|
|
|
|
|
| |
The new scheme widens termRefs everywhere variance is positive and type-aliases over termrefs everywhere indepdendent of variance.
Needed to add variance to TypeMap to make this work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
oarameter bounds.
Otherwise we would get into situations like the following (experienced in typers.Arrays):
Constraint:
B >: String
T >: B
Add B >: T to this constraint. You get:
B >: String | T,
but because T >: B >: String, the rhs reduces to
B >: T
Simplified this gives
B = T
and the String lower bound has vanished!
|
|
|
|
|
|
| |
rules. (reverted from commit 50ab9f559ad36b916d24e733df3629994d239583)
We now admit `identity _` and, if the expected type is a function type, pass this type on to the function. If the expected type is not a function type, we pass on AnyFunctionProto.
|
|
|
|
|
|
| |
under dotty rules."
This reverts commit 50ab9f559ad36b916d24e733df3629994d239583.
|
| |
|
|
|
|
| |
rules.
|
|
|
|
| |
parameters.
|
|
|
|
| |
This can prevent cyclic references during implicit search.
|
|
|
|
| |
Still need to explore where we can use this (one usage will be in TypeComparers).
|
|
|
|
| |
We need to have a place where to put (yet to be implemented) classTag/typeTag macros, which will replace the custom search for tags in Scala2x
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This was previously
C.this.self
but it should be
C.this
|
| |
|
|
|
|
|
|
|
| |
This one handles situations like
val sym: Symbol
sym.type <:< Symbol { type ThisType = sym.ThisType }
|
|
|
|
|
|
|
| |
1) endPos works now even for NoPosition.
2) On the other hand, there's an assertion in Typer.typed which requires every non-empty tree that's type checked in a globally committable context to have a defined position.
Some fixes were needed to make the tests pass the new assert.
|
|
|
|
|
| |
Normally, Predef.identity cannot be used as an expression with unknown expected type. You need a trailing `_`.
But when used as a default argument, Scala 2x allows it. I am not sure why it is allowed. In dotty it's disallowed everywhere, hence the fix.
|
| |
|
|
|
|
|
|
|
|
| |
This version expands a method ref p.m to the untyped tree
p.m(_, ..., _)
(after lifting impure expressions from p). Afterwards the usual application mechanisms kick in. This fixes problems also present in Scala 2.x, where an eta-expanded function was not as flexible as an explicitly expanded one (for instance, eta expansion did not honor default parameters).
|