diff options
author | Norman Rink <nrink@google.com> | 2023-03-13 08:55:26 +0000 |
---|---|---|
committer | Norman Rink <nrink@google.com> | 2023-03-13 14:44:21 +0000 |
commit | 29b7b3d99cc28717dc1c22b603073449fe6a2f6a (patch) | |
tree | cca3dc2b6261767ad714f2d8a0066cf345b46d4a /makefile | |
parent | 066939f8ec68512e235708e813056b6da5fab437 (diff) |
Make the check for recursive method definitions less syntactic.
This is achieved by encoding inside a `ClassArrow` which class
methods the expression "to the right" of the arrow requires
access to. The arrow can require `Full` access, in which case
all methods are accessible in the subordinate expression ("to
the right") of the arrow. Alternatively, an arrow can require
`Partial` access, in which case the `ClassArrow` also carries
a list of method indices of those methods in the class that
the arrow requires access to.
Note that the surface language has not changed: when a user
specifies a class as a (function) argument, the `ClassArrow`
resulting from this is assumed to require `Full` access.
The only place where `Partial` arrows are constructed in the
compiler is when building the types for method projections
(in function `makeMethodGetter`). A method projection requires
access to exactly one method of a class/dictionary.
During type inference, the method accesses that are required by
a `ClassArrow` are fed through to `DictHole`s. Later, when an
instance is synthesized for the `DictHole`, it is checked that
the synthesized instance has at least as many methods as the
`DictHole` requires access to.
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -304,6 +304,7 @@ quine-tests: $(quine-test-targets) file-check-tests: just-build misc/file-check tests/instance-interface-syntax-tests.dx $(dex) -O script + misc/file-check tests/instance-methods-tests.dx $(dex) -O script run-%: export DEX_ALLOW_CONTRACTIONS=0 run-%: export DEX_TEST_MODE=t |