Skip to content

Problem encountered with fauxClosure and distinct type #77

Open

Description

See: https://gist.github.com/michaelsbradleyjr/d4aed98d91a6a4a132274bd66e5af826

L20 triggers a compiler error:

bar.nim(20, 16) Error: type mismatch: got <MyString>
but expected one of:
proc payload_16600094(nameCstr`gensym16591097_16600096: distinct[cstring])
first type mismatch at position: 1
  required type for nameCstr`gensym16591097: distinct cstring
  but expression 'nameCstr`gensym16591097' is of type: MyString

expression: payload_16600094(nameCstr`gensym16591097)

I'm not sure if it's something wrong in my code or an issue with the macro's implementation or something more fundamental with Nim.

Based on the compiler error, it seems the payload proc produced by the macro has distinct[cstring] but needs to have MyString.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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