Skip to content

Remove unused assignments. Fixes #443, #444, #445 #459

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

Merged
merged 4 commits into from
Sep 18, 2024

Conversation

eldritchconundrum
Copy link
Collaborator

No description provided.

src/analyzer.fs Outdated
// [D] An augmented assignment is a read and then a write. x += 1;
// [E] A function name itself is neither a read nor a write. x();
// [F] A function call with an in parameter is a read. sin(x);
// [G] A function call with an out parameter is a write. void f(out p) { p = 1; } ... f(x);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[E] Why is it not a read?
[F] rephrase: "A in parameter in a function call is a read" (the function call itself is not a var)
[G] [H] ditto

src/analyzer.fs Outdated
let paramAccessList =
funcDecl
|> Option.map (fun funcDecl -> funcDecl.funcType.args |> List.map (fun (ty, _) -> ty.access))
|> Option.defaultWith (fun () -> args |> List.map (fun _ -> { isWrite = false; isRead = true }))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opt. might be clearer to do a match funcDecl instead of Option.map + Option.defaultWith

@eldritchconundrum eldritchconundrum merged commit 5a5a4f9 into master Sep 18, 2024
1 check passed
@eldritchconundrum eldritchconundrum deleted the 443-444-445 branch September 18, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants