summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorNorman Rink <nrink@google.com>2023-03-13 08:55:26 +0000
committerNorman Rink <nrink@google.com>2023-03-13 14:44:21 +0000
commit29b7b3d99cc28717dc1c22b603073449fe6a2f6a (patch)
treecca3dc2b6261767ad714f2d8a0066cf345b46d4a /makefile
parent066939f8ec68512e235708e813056b6da5fab437 (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--makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/makefile b/makefile
index 6fda8524..f8cdf63e 100644
--- a/makefile
+++ b/makefile
@@ -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