diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-10-18 09:30:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-18 09:30:38 -0700 |
| commit | 3a5214b65b2a5efdbcf9bf6fb4d7603e9ee63234 (patch) | |
| tree | aa77f0e7b5ca7e6327c252a8acff50ccb08a7794 /source/core | |
| parent | f9710d50bc675ddba51cc6d94b125ba1549708a8 (diff) | |
Add support for static methods in interfaces (#680)
This change allows an interface to include `static` methods as requirements, so that types that conform to the interface will need to satisfy the requirement with a `static` method.
The essence of the check is simple: when checking that a method satisfies a requirement, we enforce that both are `static` or both are non-`static`.
Making that simple change and adding a test change broke a few other places in the compiler that this change tries to fix. The main fix is to handle cases where we might look up an "effectively static" member of a type through an instance, and to make sure that we replace the instance-based lookup with type-based lookup. There was already logic along these lines in `lower-to-ir.cpp`, so this change centralizes it in `check.cpp` where it seems to logically belong.
Diffstat (limited to 'source/core')
0 files changed, 0 insertions, 0 deletions
