Skip to content
This repository was archived by the owner on Jun 17, 2022. It is now read-only.
This repository was archived by the owner on Jun 17, 2022. It is now read-only.

cast of function pointer should not be allowed #139

@mb64

Description

@mb64

It would be helpful to know how much typechecking is done by ZZ. I was under the impression it did full typechecking, so I was surprised to find that the following program transpiled to C without error:

using <stdio.h>::{printf};

fn output(int *x) {
    printf("%d\n", *x);
}

fn function() {}

export fn main() -> int {
    output(function);
}

Of course, clang halted compilation with an error. Either way, it would help to clarify in the documentation about typechecking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions