Skip to content

Error message for assigning the wrong type is backwards #2804

@jfecher

Description

@jfecher

Aim

fn main(mut x: Field, y: u32) {
    x = y;
}

Expected Behavior

error: Cannot assign an expression of type u32 to a value of type Field
   ┌─ /.../short/src/main.nr:35:9
   │
35 │     x = y;
   │         -
   │

Bug

error: Cannot assign an expression of type Field to a value of type u32
   ┌─ /.../short/src/main.nr:35:9
   │
35 │     x = y;
   │         -
   │

To Reproduce

Installation Method

None

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions