[backport] fix #12528, fix #12525: incorrect generic type resolution for default values (#12538)

This commit is contained in:
Andreas Rumpf 2019-10-28 16:56:38 +01:00 • committed by Miran
commit e58c2d261c
3 changed files with 32 additions and 7 deletions

View file

@ -2,6 +2,8 @@ discard """
output: '''
100
0
float32
float32
'''
"""
@ -110,3 +112,15 @@ block tgeneric4:
newSeq result.free, 0
var x = newIDGen[int]()
block tgeneric5:
# bug #12528
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)