Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
timotheecour opened this issue Jan 31, 2020 · 1 comment
Closed

Comments

@timotheecour
Copy link

@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

@yglukhov
Copy link
Owner

yglukhov commented Feb 3, 2020

I will be happy to ditch variant.getTypeId for typetraits as long as it passes my tests, but currently it fails. You can check it yourself, just comment out getTypeId impl in variant.nim, add import typetraits, and run nimble test :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants