Skip to content

variant.getTypeid clashes with stdlib PR for typetraits.getTypeid #5

Closed
@timotheecour

Description

@timotheecour

@yglukhov just opening a discussion:
nim-lang/Nim#13305 introduces getTypeid(T): int which seems better, simpler, faster (AFAIU) than variant.getTypeid; currently my PR fails because it clashes with ambiguous symbol error:

C:\Users\VssAdministrator\.nimble\pkgs\nimx-0.1\nimx\class_registry.nim(53, 61) Error: ambiguous call; both typetraits.getTypeid(t: typedesc) [declared in d:\a\1\s\lib\pure\typetraits.nim(19, 6)] and variant.getTypeId(t: typed) [declared in C:\Users\VssAdministrator\.nimble\pkgs\variant-0.2.10\variant.nim(126, 7)] match for: (type RootRef)

that PR is not finalized (nor accepted etc) yet but I'm wondering what's the best course of action;
one easy option is to simply change: getTypeId => variant.getTypeId in class_registry
but down the line it'd be maybe best to either rename variant.getTypeId or use the new typetraits.getTypeId

first question for you is: does typetraits.getTypeId provide a suitable replacement for variant.getTypeId ? feel free to try out the PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions