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

type() not working correctly when defining a function result type #9190

Open
dawkot opened this issue Oct 4, 2018 · 1 comment
Open

type() not working correctly when defining a function result type #9190

dawkot opened this issue Oct 4, 2018 · 1 comment

Comments

@dawkot
Copy link

dawkot commented Oct 4, 2018

func foo[T, U]: type(T.low + U.low) = 
  T.low + U.low

Error: ambiguous call; both system.+(x: float32, y: float32)[declared in ../../.choosenim/toolchains/nim-0.19.0/lib/system.nim(1130, 5)] and system.+(x: float, y: float)[declared in ../../.choosenim/toolchains/nim-0.19.0/lib/system.nim(1137, 5)] match for: (type(T.low), type(U.low))

However, his compiles fine:

func bar[T, U] = 
  var x: type(T.low + U.low)

bar[int, int]()
@zah zah added the Generics label Dec 26, 2018
@stale
Copy link

stale bot commented Aug 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Aug 4, 2020
@metagn metagn added works_but_needs_test_case and removed stale Staled PR/issues; remove the label after fixing them labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants