-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Inference failure with int inference variable #26841
Copy link
Copy link
Open
Labels
A-inferenceArea: Type inferenceArea: Type inferenceA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-inferenceArea: Type inferenceArea: Type inferenceA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Given that the type of
bisu8, the type ofais a builtin integer type, and the result ofa+ais assigned tob, the type ofamust beu8. Currently, this rule only applies "forwards": it only works ifais known to be a builtin integer type when the addition is being checked. However, type inference could be extended to apply it backwards as well.I'm not sure if this is relevant in practical usage of Rust.