diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-07 14:50:56 +0200 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-05-20 13:38:48 +0200 |
commit | c2d5246bdb33d60d3eaff62a539d01368124d859 (patch) | |
tree | 8042d19558c350597655d5bb1dfee4ffa25e02d6 /tests | |
parent | 2d3c79f7cf3e79b592c7e479d262e8d3f9b04959 (diff) | |
download | dotty-c2d5246bdb33d60d3eaff62a539d01368124d859.tar.gz dotty-c2d5246bdb33d60d3eaff62a539d01368124d859.tar.bz2 dotty-c2d5246bdb33d60d3eaff62a539d01368124d859.zip |
More systematic treatment of prototypes.
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/bigint.scala | 7 | ||||
-rw-r--r-- | tests/pos/t1693.scala (renamed from tests/pending/pos/t1693.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t1832.scala (renamed from tests/pending/pos/t1832.scala) | 0 | ||||
-rwxr-xr-x | tests/pos/t2060.scala (renamed from tests/pending/pos/t2060.scala) | 0 |
4 files changed, 7 insertions, 0 deletions
diff --git a/tests/pos/bigint.scala b/tests/pos/bigint.scala new file mode 100644 index 000000000..e1aaaf96e --- /dev/null +++ b/tests/pos/bigint.scala @@ -0,0 +1,7 @@ +import scala.math.BigInt +//import BigInt._ +object test { + + 1 * BigInt(0) + +} diff --git a/tests/pending/pos/t1693.scala b/tests/pos/t1693.scala index 881bf89a0..881bf89a0 100644 --- a/tests/pending/pos/t1693.scala +++ b/tests/pos/t1693.scala diff --git a/tests/pending/pos/t1832.scala b/tests/pos/t1832.scala index 9ad9703c2..9ad9703c2 100644 --- a/tests/pending/pos/t1832.scala +++ b/tests/pos/t1832.scala diff --git a/tests/pending/pos/t2060.scala b/tests/pos/t2060.scala index 0b9079062..0b9079062 100755 --- a/tests/pending/pos/t2060.scala +++ b/tests/pos/t2060.scala |