Skip to content

future/sugar => syntax breaks with generics #7816

@bluenote10

Description

@bluenote10

Recently I'm getting all kinds of compilation errors when using the future/sugar => syntax. I now noticed that it is related to generic procs:

import sequtils
import sugar

proc tester[T](x: T) =
  let test = toSeq(0..5).map(i => newSeq[int]())

tester(1)

Error:

test.nim(7, 7) template/generic instantiation from here
test.nim(5, 32) template/generic instantiation from here
lib/system.nim(3559, 14) Error: cannot instantiate: 'T'

The expression does work when it appears in a non-generic context, and I'm pretty sure such code used to work before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions