Skip to content

bug: implicit *void -> *T casting does not occur in function arguments #708

@thetayloredman

Description

@thetayloredman

Before we begin...

  • I have updated the Zirco toolchain to the latest version
  • I have searched the issue tracker for duplicates

What happened?

$ zrc - << EOF
struct S { x: i32 }
fn f(x: S);
fn main() -> i32 {
    f(0 as *void);
    return 0;
}
EOF
[E3010] Error: expected `struct { x: i32 }` for argument `0`, got `*struct {}`

What version of Zirco are you running?

HEAD

How can this bug be reproduced?

See above.

What behavior did you expect?

The code should compile.

What actually happened?

The code does not compile, and prints an error message.
Additionally, that error message lacks labels.

Other Context

Workaround: Just write the cast yourself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-typeckRelating to the type checkerE-help-wantedCall for participation: Help is wanted!P-highThe bug disrupts many use cases of the compilerS-workaroundA workaround is known.T-bugSomething isn't working (use type: ice for panics)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions