| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The first part of a type ascription e: T can be a pattern or an expression. The mode
has to be kept depending on what it was on the outside.
|
|
|
|
|
| |
Auxiliary constructors need to be wrapped in the type parameters of the primary constructor.
Otherwise they will not take part in type inference.
|
|
|
|
|
|
|
| |
Needed to wrap a dummyTreeOfType in a TypedSplice to prevent re-typechecking. (In fact, the
"tree without pos" check revealed a deeper problem: DummyTrees of types could be typed again,
but without the surrounding TypedSplice, the originally stored type would be forgotten and Null
would be returned.
|
| |
|
|
|
|
|
|
|
|
|
| |
Another problem where we need to insert an implicit on the result type of complex operation.
Two additions: (1) If adapt fails, we now try with a weaker FunProto without result type, thus
allowing for an additional implicit cpmversion on the result. (2) An Application in a committable
context will not fail if the result type does not match the expected one. The problem will be
simply deferred in that case.
|
|
|
|
|
|
| |
This fixes a bug introuced by 7754c1ee6c4230e424fd99b820471dbd2c1c8390.
The reporter state need to be reset undconditionally in a tryWithFallback.
|
|
|
|
|
|
| |
1) glb/lub's are reported to subtyping printer instead of typr
2) Null arguments of function protos are printed with their types
(views sometimes are transformed into these).
|
|
|
|
| |
"_" type paraeters need to be given fresh names.
|
|\
| |
| | |
Small fixes
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
See discussion in #128
|
|\ \
| | |
| | | |
More tests
|
| | |
| | |
| | |
| | | |
becaus this is the limit imposed by Travis
|
| | | |
|
| | |
| | |
| | |
| | | |
I still have 1.6 installed. So the two simple fixes are necessary to make my build pass for now.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This was a hard nut to crack. The problem exemplified by t2429 is that in a situation like
val x: T = foo(...)
where `foo` needs implicit parameters the expected result type `T` is propagated into the
typechecking of foo(...) and consequently also into the implicit parameter search. This
is often necessary, for instance to instantiate type parameters. But it can lead to overconstrained
searches if in fact the right expansion is
val x: T = viewToT(foo(...)(implicit params))
where `viewToT` is some implicit conversion. The fix handles that case by re-hecking the
application foo(...) with an empty result type, if the implicit parameter search fails.
But the re-checking is very subtle as is explained in the comment to `TyperState#tryWithFallback`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
bin as output directory clashes with bin/dotc.
Btw I have no idea why I cannot ignore .gitignore. I have .gitignore in my .gitignore_global
and have configured git to respect that, but no cigar.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fix so it isn't.
This caused an error in ErrorReporting because we do not propagate
bounds into a type like ValOrDefDef[_]. Error in `ErrorReporting` is now fixed but the problem is
reflected in test case `boundspropagation`.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Doing so is unsound. We instead approximate local classes by their parents, but
only if the expected type is not fully defined.
This makes the test t2421_delitedsl1.scala in the commit pass. The oter test,
blockEscapesNeg.scala is modified to fail. Previously it failed outright but with the
new rules the nested class Bar is approximated to Object. That means that the block
containing `Foo.Bar` typechecks, but with type `Object` instead of the unreachable `Bar`.
|
| | |
| | |
| | |
| | |
| | | |
Used to be just $anon, now is `Ps { ... }`, where `Ps` are
the instantiated parents of the anonymous class.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There's a delicate balance about how much of a prototype should be passed down the
tree when typechecking. Passing little can cause ambiguity errors (both in overloading
and in implicit search). Passing too much can cause spurious errors because implicit conversions
"down the road" that apply to some tree continaing the result might not be considered.
Symptoms of the problems wree that we could not handle the tests included in this commit before.
The new scheme is as follows: we always keep all available information in a prototype, but hide nested
prototypes behined a `IgnoredProto` wall. These trees will not be considered for conformity checking.
When type checking hits an ambiguity, it tries again with a prototype that's one level deeper (has fewer
Ignore links) than the previous one. This continues until there are no more Ignore links to unwrap.
We also generalize the scheme for wrapping qualifiers of select nodes from realApply to all instances where
we compare against a FunProto.
Finally, there are some fixes that avoid assertion violations that were provoked by the new typechecking scheme.
|
| | | |
|
| | |
| | |
| | |
| | | |
We now restrict wildcard imports to members that are accessible at the point of import. This is a fix of an open Scala ticket.
|
| | | |
|
| | |
| | |
| | |
| | | |
Refactored reporters to increase clarity and to pave the way for having Diagnostics subclasses.
|
|/ / |
|
|\|
| |
| | |
Fix/erasure 2
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The superclass comnstructor of a ClassDef is supposed to be a constructor call. The fix
ensures this is the case when creating classes with tpd.ClassDef.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The previous scheme checked all constraint bounds twice everytime
the bounds for a parameter in a constraint were changed. The new scheme,
which can be disabled by unsetting `Config.trackContrDeps`, only
checks those cbounds that directly or indirectly mention the changed
parameter.
|
| |
| |
| |
| | |
With the previous fixes, we can now compile dotc/transform without errors.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1) We now demand that all implicit defs have an implicit type, not
just class members. If we admitted implicit term members without
explicit types, the rules and algorithms for dteremining eligible
implicits would be greatly complicated (because there's always the
danger that inferring the type by typechecking the rhs causes a cyclic
reference).
2) We check for violations of this rule earlier, during type completion, in order
to avoid cyclic references happening before we do the check.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we intersect a higher-kinded type C with an instance C[T],
we should expect C[T].
Conversely, taking the union of a higher-kinded type C and an
instance C[T] should give C.
Previously, the higher-kinded place-holder $hkN was merged with
&/| with the type T which led to type errors.
|
| |
| |
| |
| | |
Fixes to make the files in `transform` compile in Dotty.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Test case in TreeTransformers.scala. We have there
type Mutator[T] = (TreeTransform, T, Context) => TreeTransform
It turns out that then Mutator[X] for some type X did not typecheck because
the typer got confused what were the type parameters of the Function3 type on
Mutator's RHS. The fix adds a case to handle RefinedTypes that bind type
parameters.
|
| |
| |
| |
| |
| | |
Instead of replacing all constrained poly params by their lower bounds before checking satsfiability,
we now do this on the fly in the subtype tests.
|
| |
| |
| |
| | |
t0786 works again after type inference fixes. Re-enabling.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
defaultOptions is now an implicit parameter, which means it can be overridden
on a call-by-call basis.
Added -Ycheck:front to verify that typed trees typecheck again with same types.
The option is disabled for one of the structural tests.
|
| |
| |
| |
| |
| |
| |
| |
| | |
1) PolyParams are now approximated with a bounded wildcardtype representing
the bounds in the current constraint, rather than the bounds in the parameter's
declaration. That makes them consistent with the handling of TypeVars.
2) Wildcard types are taken into consideration when result types are constrained.
|
| |
| |
| |
| | |
This is an opimization to save on unncessessary typed implicits.
|
| |
| |
| |
| |
| |
| | |
Satisfiability was too loose before. It is noww tightened. We check that the lower bounds
of all constrained parameters represent a solution to the constraint. To make the check pass
we have to first propagate the constraint by re-verifying all bounds.
|
| |
| |
| |
| |
| | |
null is not a subtype of a singleton type in Dotty. This slipped by the type checker before.
With the tightened rules in the next commits, it will become illegal.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Literals need to be promoted as is, because constant folding might
have changed the type of the literal to the expected type. E.g. in
val x: Byte = 2
The literal 2 will have type `Byte(2)` but its underlying constant will still be `Int(2)`.
So re-typing would give the wrong type.
|