Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Make linear types @inout by default; add @owned annotation #486

Merged
merged 28 commits into from
Sep 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
40e9701
Drive-by: change name of parse_docstring
croyzor Sep 10, 2024
ec3072e
Drive-by: Say which identifiers are unknown
croyzor Sep 10, 2024
091802e
checkpoint: integration tests
croyzor Sep 11, 2024
1edb8f0
Update comprehension error tests
croyzor Sep 11, 2024
24e7d04
Update inout error files
croyzor Sep 11, 2024
d5db2e7
Update linear error files
croyzor Sep 11, 2024
e64155f
Update misc error tests
croyzor Sep 12, 2024
8a0976d
Only print the missing module for attributes
croyzor Sep 12, 2024
b982bc4
Update more error files
croyzor Sep 12, 2024
ea04238
Merge remote-tracking branch 'origin/main' into feat/owned
croyzor Sep 12, 2024
217d471
Fix printing of flags
croyzor Sep 12, 2024
718c2c7
Review comments
croyzor Sep 12, 2024
f07175a
Add new test case
croyzor Sep 12, 2024
6fa60fd
Update error files
croyzor Sep 12, 2024
8f9b7de
Review comment: update used_twice
croyzor Sep 12, 2024
8c911ee
revert pyproject change
croyzor Sep 12, 2024
45be26d
Shut up mypy
croyzor Sep 12, 2024
11d9642
Update references to @inout
croyzor Sep 12, 2024
fe69a36
Merge branch 'main' into feat/owned
croyzor Sep 12, 2024
df989bb
Take ownership of linear args to struct constructors
croyzor Sep 13, 2024
fc75c81
Add tests for linear struct initialisation
croyzor Sep 13, 2024
b8fe162
Make check an assert
croyzor Sep 13, 2024
b13e547
chore: Unskip now-passing tests (#475)
aborgna-q Sep 12, 2024
f32cd61
Merge remote-tracking branch 'origin/main' into feat/owned
croyzor Sep 13, 2024
a34d824
Update guppylang/tys/ty.py
croyzor Sep 13, 2024
46d32a1
Update guppylang/checker/linearity_checker.py
croyzor Sep 13, 2024
7c7e2d0
Update guppylang/tys/parsing.py
croyzor Sep 13, 2024
fdf10f2
Update tests; mypy annotations
croyzor Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion guppylang/tys/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def type_from_ast(
) -> Type:
"""Turns an AST expression into a Guppy type."""
ty, flags = type_with_flags_from_ast(node, globals, param_var_mapping)
if flags != InputFlags.NoFlags and flags != InputFlags.Inout:
if flags != InputFlags.NoFlags:
assert flags != InputFlags.Inout # Users shouldn't be able to set this
croyzor marked this conversation as resolved.
Show resolved Hide resolved
raise GuppyError(
"`@` type annotations are not allowed in this position",
node,
Expand Down