Skip to content

broken @as in external does weird things #7948

@tx46

Description

@tx46

i just inlined a small binding in a file:

module Node = { module Fs = { @module("node:fs") external existsSync: string => bool = "existsSync" @module("node:fs") external readFileSync: (string, @as(json`"utf8`) _) => string = "readFileSync" } } 

i missed the closing " after utf8. having format on save, the formatter did a weird change:

 external readFileSync: ((string, @as(json`"utf8`) _)) => string = "readFileSync" 

it added a double set of parens. this is a really edge case scenario so you may throw this in the trash if you like

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