Skip to content

Support non-basic type constraints #200

Open
@samherrmann

Description

@samherrmann

This issue is to track the limitation that was mentioned in the description of #175.

Consider the following interface:

type Sorter[T comparable] interface {
	Sort(slice []T) []T
}

When generating a mock using moq v0.3.2, the following implementation check is created:

var _ Sorter[comparable] = &SorterMock[comparable]{}

This code is not valid due to the following reason:

cannot use type comparable outside a type constraint: interface is (or embeds) comparable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions