Closed tk3369 closed 4 years ago
Yes, I was missing that, too. I think it is easy to change that in check
by additionally checking all supertypes of Duck
(except Any
- we should also disallow to assign an interface to Any
).
In the case we support also parameter types, we must extend the checks to UnionAll
Consider this example:
Since I assigned the abstract type
Bird
with theFly
trait and theFly
trait requires an interface contractliftoff
, I expect bothDuck
andChicken
to satisfy that contract. However:The interface check should traverse super-type tree and check all required contracts.