derived generic types with static[T] breaks type checking in v0.15.0 (worked in v0.14.2) #4863

Closed
jxy opened this Issue Oct 7, 2016 · 1 comment

Projects

None yet

2 participants

@jxy
jxy commented Oct 7, 2016

The following code worked in v0.14.2 but breaks in v0.15.0.

type
  G[i,j:static[int]] = object
    v:float
  H[j:static[int]] = G[0,j]
proc p[i,j:static[int]](x:G[i,j]) = echo "G:",i,",",j,":",x.v
proc q[j:static[int]](x:H[j]) = echo "H:",j,":",x.v

var
  g0 = G[0,1](v: 0.1)
  h0:H[1] = g0
p(g0)
p(h0)
q(h0)

With v0.15.0, you get

t_gentype_match.nim(6, 8) Error: cannot instantiate: 'j'
  proc q[j:static[int]](x:H[j]) = echo "H:",j,":",x.v
         ^
@Araq Araq added the Regression label Oct 8, 2016
@jxy
jxy commented Oct 14, 2016

The commit, 3a13706, introduced this issue. Some problem with changes in sigmatch.nim?

@Araq Araq added a commit that closed this issue Oct 19, 2016
@Araq Araq fixes #4863 d0ec83e
@Araq Araq closed this in d0ec83e Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment