| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Fix numeric implicit args
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Compiling scala.math.BigDecimal and scala.math.BigInteger shows a problem.
The conversion `int2bigInt` is not applicable to a Byte because `Byte -> Int`
requires another implicit conversion.
We fix that by using a new method relaxed_<:< for implicit compatibility checks,
which always admits numeric widenings.
This leads to another problem. Now the conversions
implicit def byteToInt(x: Byte): Int
implicit def byteToShort(x: Byte): Short
are ambiguous when we try to convert from Byte to Int.
We fix that by adding a "tie-break" to implicit search
where if several methods match a numeric value result type
and all have numeric value types as result types, we
pick the numerically largest type that matches.
|
|/
|
|
|
|
|
|
| |
These were disabled before, which means that having evidence
of S <:< T did not introduce a usable implicit conversion from
S to T. We do do it like scalac: just disable Predef.$conforms.
This makes TraversableOnce compile. Fixes #914.
|
|
|
|
|
|
| |
Was missing before. Needed a tweak in PlainPrinter for printing
import symbol references (their denotation is not current after pickling, so
they would have printed differently after and before pickling).
|
| |
|
| |
|
|
|
|
| |
Moved some working test to pos. I wonder why they were in pending? They did work for me.
|
| |
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
| |
"_" type paraeters need to be given fresh names.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Made desugaring hygienic. Trees that are derived from some other tree are no longer stored as simple
untyped Ident trees, but as TypeTrees that know how to derive their types from some other type.
Test cases in pos: hygiene.scala, t0054.scala and t0085.scala.
The comment in hygiene.scala points to the difficulties we are facing. In particular, we need type
trees that can rebind some references of a source type to local occurrences with the same name. t0054.scala is similar to hygiene.scala. t0085.scala is trickier, but also related. Essentially the problem there is that we have a class
that inherits its outer class. In this case it is important to resolve an identifier in the right context. The identifier added to the copy method of a case class must be resolved outside the class (just like the same
identifier in the constructor of that case class).
|
|
This test case exercised several problems:
1.)2.) Two ways to run into a cyclic references. Fixed by
- assuming an early info when completing a typedef, similarly to what is done for a classdef
- doing wellformed bounds checking in a later phase.
Failure to check whether arguments correspond to F-bounds.
- a substitution was missing.
|