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

Unification of Never Type #6391

Open
IGI-111 opened this issue Aug 7, 2024 · 0 comments · May be fixed by #6911
Open

Unification of Never Type #6391

IGI-111 opened this issue Aug 7, 2024 · 0 comments · May be fixed by #6911
Assignees
Labels
audit-report Related to the audit report bug Something isn't working P: low team:compiler Compiler Team

Comments

@IGI-111
Copy link
Contributor

IGI-111 commented Aug 7, 2024

CS-FSSA-025
Some operators like return are assigned to a Never type also denoted with !. This represents
expressions whose evaluation cannot be assigned if they're on the right-hand-side. When never is
unifified with another type, then the other type should dominate. Consider the following example:

fn main(){
 let mut v: u32 = 1; // (1)
 v = return; // (2)
}

In the example, the type of v is u32 from (1) and is also assigned a ! from (2). Since ! is always
unified with any type the snippet successfully type checks. However, the following does not type check,
even though it's a similar case.

fn main(){
 let mut v: u32 = return;
 v = 1;
}
@IGI-111 IGI-111 added bug Something isn't working P: low audit-report Related to the audit report labels Aug 7, 2024
@jjcnn jjcnn added the team:compiler Compiler Team label Feb 10, 2025
@jjcnn jjcnn linked a pull request Feb 10, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-report Related to the audit report bug Something isn't working P: low team:compiler Compiler Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants