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

[Improvement]: Detect usages of check where it used in the context of a type that contains an error #40238

Open
hasithaa opened this issue Apr 18, 2023 · 0 comments
Labels
Area/CompilerLinter Compiler linter Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Improvement

Comments

@hasithaa
Copy link
Contributor

Description

This leads to dead code blocks. For example,

int|error val = check getInt();
if val is int {

} else {
 // never reach here. 
}

Even though assigning to a wider type is a valid use case, we need to detect this use case, and help the user to write the correct code.

Describe your problem(s)

No response

Describe your solution(s)

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@hasithaa hasithaa added Type/Improvement Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Area/CompilerLinter Compiler linter labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/CompilerLinter Compiler linter Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Improvement
Projects
None yet
Development

No branches or pull requests

1 participant