Skip to content

@as in extern can crash compiler #7972

@tx46

Description

@tx46

trying to create an extern that takes only unit and actually injects some json with no other args crashes the compiler:

@scope("somescope") external myfn: @as(json`{foo:true}`) _ => string = "somefn" 

gives

Fatal error: exception File "compiler/ml/ast_uncurried.ml", line 7, characters 9-15: Assertion failed 

works if i add another arg:

@scope("somescope") external myfn: (unit, @as(json`{foo:true}`) _) => string = "somefn" 

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