aboutsummaryrefslogtreecommitdiff
path: root/tests/run/innerObject.check
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-19 11:32:44 +0200
committerMartin Odersky <odersky@gmail.com>2016-05-19 11:32:44 +0200
commitc29e9754b94cc352337791c9e36131f5b8be385d (patch)
treede7a11d622af2bd7f1dd44ef8eaf494242afdad1 /tests/run/innerObject.check
parentc9ac3d7267fe53dfbd3f57658049637ab218b3d5 (diff)
downloaddotty-c29e9754b94cc352337791c9e36131f5b8be385d.tar.gz
dotty-c29e9754b94cc352337791c9e36131f5b8be385d.tar.bz2
dotty-c29e9754b94cc352337791c9e36131f5b8be385d.zip
Fix dotc bootstrap failure
During an attempted dotty bootstrap it was noted that Types.scala did not compile anymore, because `checkUnique` threw a `TypeError` during erasure. The issue was an overloaded member `name` in TermrefWithSig. In NamedType: def name: Name In TermRef: def name: TermName Before erasure, there's one member `name`, after erasure there are two (because after erasure result type counts). The error arose when trying to recompute a member of a `TermRefWithSig` where the name is `name` and the expected signature is `(Nil, ?)`. Since there are two members that match the name and the signature, `checkUnique` triggered a `TypeError`. Before adding `checkUnique`, the previous `atSignature` call would just have returned an arbitrary choice among the two alternative definitions of `name`. The fix is not to use `checkUnique` but to fall back to `d.current` in the case where several alternatives appear. Interestingly, the failure only triggers when -Ycheck options are *disabled*. I added a new test that compiles Types.scala without checks, so we catch this and possibly similar bugs in the future.
Diffstat (limited to 'tests/run/innerObject.check')
0 files changed, 0 insertions, 0 deletions