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

generic argument with default value causes incorrect generic type resolution #12528

Closed
krux02 opened this issue Oct 26, 2019 · 0 comments
Closed

Comments

@krux02
Copy link
Contributor

krux02 commented Oct 26, 2019

Example

proc foo[T](a: T; b: T) =
  echo T

foo(0.0'f32, 0.0)

proc bar[T](a: T; b: T = 0.0) =
  echo T

bar(0.0'f32)

Current Output

float32
float64

This is very strage, because the type T should depend on the first argument a, which is definitively float32.

Expected Output

float32
float32

Additional Information

krux02 added a commit to krux02/Nim that referenced this issue Oct 26, 2019
Araq added a commit that referenced this issue Oct 28, 2019
narimiran pushed a commit that referenced this issue Oct 30, 2019
…for default values (#12538)

(cherry picked from commit e58c2d2)
kiyolee pushed a commit to kiyolee/nim that referenced this issue Nov 7, 2019
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

2 participants