| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Two benefits: (1) less code. (2) finding subtle bugs about
parameter dependent method types. By merging with PolyTypes
we are forced to take parameter dependencies into account.
|
|
|
|
|
| |
- Use TypeLambda instead of PolyType.
- Further harmonize factory operations
|
|
|
|
|
|
| |
MethodTypes have paramTypes whereas PolyTypes have paramBounds.
We now harmonize by alling both paramInfos, and parameterizing
types that will become common to both.
|
|
|
|
|
| |
Now we never match `? { name: T }` with types that
have only a private `name` member. This is what scalac does, too.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|/ |
|
|\
| |
| | |
Fix #1907: Improve error message
|
| |
| |
| |
| |
| |
| |
| |
| | |
It seems in most cases this leads to weird behavior and cause
confusing error messages later.
It also means we cannot create an Array[Nothing], except by
passing the classtag explicitly.
|
| |
| |
| |
| |
| |
| | |
The previous implicit definition of arrayTag in DottyPredef
priorities arrayTag over all other classtag searches, which
led to surprising results in `i1907a.scala`.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous condition for caching companionRefs contained a condition
result.companionRefs.forall(implicitScopeCache.contains)
which was always false because we cache types in `implicitCodeCache`, not
companion refs. The new logic fixes this and does not need a second traversal
because it is integrated in `iscopeRefs`.
|
|\ \
| | |
| | | |
Fix to wildapprox
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
f-bounded-case-class.scala exhibited a StackOverflow in wildApprox before
the fixes. The problem was due to F-bounds.
Note: wildApprox is performance critical. I ran timed-bootstrap-repeated
a couple of times to verify that the changes did not affect runtimes in
significant ways. We should also watch out for a slowdown in the
benchmark tests.
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
The previous condition for caching companionRefs contained a condition
result.companionRefs.forall(implicitScopeCache.contains)
which was always false because we cache types in `implicitCodeCache`, not
companion refs. The new logic fixes this and does not need a second traversal
because it is integrated in `iscopeRefs`.
|
| |
|
|
|
|
|
| |
We got on NPE when compiling the collection strawman under -Yno-imports. We did not
preview that the contextual implicit scope stack could be empty.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
When the expected type is an implicit function, create an
implicit closure to match it.
|
|
|
|
|
|
| |
This will need a spec change. It's necessary in
order not to confuse synthetic implicits with each other
or with explicit ones in the environment.
|
|
|
|
|
|
|
| |
When tracing i1639.scala it became apparent that we compute
a lot of companion refs. This commit avoids this by better
book-keeping what is valid and what is not and more
aggressive caching.
|
|
|
|
|
| |
Error messages of nested implicit failures are now
reported with the top-level message if -explaintypes is set.
|
|
|