| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
1) Desugar type bounds containing empty trees
2) Include a productN parent for a case class, only if the case class has 2 or more parameters in its parameter section.
Also, handle type bounds appearing in AppliedTypeTrees (these represent wildcard types).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to take account of the possibility of inserting a () argument list in normalization. Otherwise, a type with a
def toString(): String
member would not count as a valid solution for ?{toString: String}. This would then lead to an implicit insertion, with a nice explosion of inference search because of course every implicit result has some sort
of toString method.
The problem is solved by dereferencing nullary method types if the corresponding function type is not
compatible with the prototype.
|
| |
|
| |
|
|
|
|
| |
Changed format of UnApply nodes to also take implicit parameters. See doc comment in class Trees.UnApply
|
|
|
|
|
|
|
|
|
|
| |
This is quite drastic. The problem is, we do not really know what to do with annotations in types. In a case demonstrated by dotc.ast.CheckTrees, a substitution of type parameter T in
class Trees[-T @uncheckedVariance]
gave us Trees[Type @uncheckedVariance], which messed up type inference in implicit search afterwards. In the case above, we clearly want to lose the annotation if the underlying type is not a type variable. Even if the underlying type is a type variable, the annotation looks wrong, since it should apply only to T, not that other variable. So the safest route seems to be to just drop the annotation.
That was a specific case, how to draft a general rule? In the absense of a better idea, it seems safest to always drop type annotations if the underlying type changes in a transformation. If some map does not want that behavior it would have to implement the AnnotatedType case explicitly.
|
| |
|
|
|
|
| |
Shadowing got confused if the shadowing expression truned out to be a closure.
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously, if the result of an unapply arg type is a type with isDefined and get methods, we proceed as follows:
if the get result type is a product: take the produce argument types
otherwise take the get result type itself
The problem is if the get result type is an empty product. We solve this by demanding that the get result type is a ProductN type, not just a subclass of product.
|
|
|
|
|
|
|
|
| |
1. Shadowing tree uses adaptation funProto of prototype. Previously many shadowing tries failed with errors like "need to follow with "_" to adapt to function". These early failures hid potential shadowing conflicts.
2. Shadowing conflict testing is now done using symbols instead of comparing references. Comparing references gave false negative when a shadoing tree had inferred type parameters, for instance. There were other problems as well. Generally, comparsing references seems too fragile.
3. Inferred views are now re-adapted. This is necessary if the view itself takes another implicit parameter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Faced with a pattern like
Apply(x, xs)
we first look for an Apply object which is an extractor. If this fails, we now
interprete Apply as a type. If it is a type alias which points to a class type that
has a companion module, we then try that companion module as an extractor.
Scala 2.x does ot that way, and it's used widely within dotty itself. Think tpd.Apply as the found object,
Trees.Apply as the extractor.
Also, added a fix to normalization which made normalization go deep into a method type.
|
| |
|
| |
|
| |
|
|
|
|
| |
The previous addition of checkClassTypeWithStablePrefix to Namer#classSig needs to be adjusted.
|
|
|
|
|
| |
The previous treatment would force all members, causing cyclic reference errors.
We fix it by filtering early in computeMemberNames itself for implicits.
|
| |
|
|
|
|
| |
Previously, we did not strip off the => when comparing against expected type.
|
|
|
|
|
|
|
| |
Fixes for
var x: T = _
super.f(...)
|
|
|
|
| |
Plus some small tweaks in Typer
|
| |
|
|
|
|
| |
Was only needed as a parameter to a continuation, so it seemed easier to just pass the components directly.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Also fixes to typedReturn.
Adapted tests accordingly.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Added check for double def if owner of scope is not a class. For class members we will need a more refined
check. One way to do it is to immediately rule out doubly defined members with same signature.
|
| |
|
| |
|
|
|
|
|
|
|
| |
1. Changes to SAMType extractor
2. Self names are no longer members of enclosing class
3. SAM-Type closures now print with their result type.
4. refactoring newSkolemSingleon ==> narrow
|
|
|
|
|
|
|
|
|
| |
1. We forgot to mark declaration symbols Deferred.
2. Types with NoPrefix and the same name got identified. Fixed by adding a new category WithNoPrefix to named types, and changing the way named types get generated.
3. Self types lacked parameters. (Question: Do we need to also track type members?)
4. Printers caused cyclic reference errors. Now some print operations are more careful with forcing.
5. Namedparts accumulator has to be more careful with ThisTypes. Because self types now contain parameters, which might lead back to this, we only add the class name (or the source module, if it's a module class).
6. toBounds in TypeApplications needs to use Co/Contra aliases for expanded name parameters, not just local ones.
|
|
|
|
|
|
|
|
|
|
| |
We ran into a flase path in a situation like this before:
A <: B where
Type A: A type alias that refers to a constrainable PolyParam P.
Type B: An abstract type with bounds L..H.
Previously, we would have instantiated P to L, whereas instantiating to B would be the right choice.
|
|
|
|
| |
Before, TreeInfo would mis-predict whenever trees were inserted with TypedSplice. We should make sure the rest of the compiler also takes TypedSplices into account when matching on trees. It's a systemic risk. Not sure we can avoid it with a better design.
|
|
|
|
|
|
| |
1. Got rid if InSuperInit mode bit.
2. Fixes to typing assignments
3. Import qualifiers need to be stable
|
|
|
|
|
| |
1. Lifted defs should not get expr or singleton types of the lifted value. Need to widen.
2. In op-assignments we need to lift the prefix of the lhs function, not the function itself.
|
|
|
|
| |
Fixed a problem where an import and a definition in same scope were erroneously regarded as a conflict (L20 in typedIdents.scala)
|
|
|
|
|
|
|
| |
The problem was that in FunProto#typedArg we cache typed arguments, to retrieve them later, possibly in a different context (Example: typedArg might be computed during overloading resolution, and then cached copy
might be inserted in resolved call. The problem is that any errors, warnings or other diagnostics might be swallowed, if typedArg is computed in a context that is not committed but then re-used in a committed context.
The fix is to cache typed arguments only if no diagnostics were issued during their computation.
|
| |
|
|
|
|
| |
with symbolic name.
|
| |
|
| |
|
| |
|