Skip to content

cannot instantiate T, even when matching overload that doesn't require T exists #24688

Open
@arnetheduck

Description

@arnetheduck

Description

type
  R[T, E] = object
  A = object
  B = object

# Remove this overload to make it work
func err[T](_: type R[T, void]): R[T, void] = discard

func err(_: type R): R[A, B] = discard

echo R.err()

Nim Version

2.0, 2.2

Current Output

testit.nim(11, 7) template/generic instantiation of `err` from here
testit.nim(6, 10) Error: cannot instantiate: 'T'

Expected Output


Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions