cli: write composed specialization identities iteratively
This commit is contained in:
1 parent
f5e2af15e8
commit
d98ddbc073
7 files changed
+284
-37
No files matched your search
@@ -100,4 +100,19 @@ fn main() -> u32 effects [] {
|
||||
entry.write_text("module app.entry\nimport app.lib;\nfn main() -> u64 effects [] { return app.lib.id::<u64>(); }\n")
|
||||
error = json.loads(cli("check", "--manifest", manifest, code=1))
|
||||
assert error["function"] == "app.lib.id<u64>"
|
||||
# Composed arguments can exceed one ty() traversal's depth while the active
|
||||
# specialization stack is still bounded. Every CLI entry rejects identically.
|
||||
for width in (31, 63):
|
||||
source = REPO / f"tests/conformance/source/generics/composed_identity_growth_{width}.aji"
|
||||
lines = source.read_text().splitlines()
|
||||
line = next(i for i, text in enumerate(lines, 1) if text.startswith("fn grow<"))
|
||||
col = lines[line - 1].index("grow::<") + 1
|
||||
expected = cli("check", source, code=1)
|
||||
diagnostics = [json.loads(text) for text in expected.splitlines()]
|
||||
assert len(diagnostics) == 1, diagnostics
|
||||
error = diagnostics[0]
|
||||
assert (error["code"], error["reason"], error["name"]) == ("E7006", "implementation_limit", "grow"), error
|
||||
assert (error["file"], error["line"], error["col"]) == (str(source), line, col), error
|
||||
for command in ("lower", "report", "run", "explore"):
|
||||
assert cli(command, source, code=1) == expected
|
||||
print(f"source generic CLI integration passed ({checks} checks)")
|
||||
Reference in new issue
Block a user