Skip to content

v1.3.0

@paddycarver paddycarver tagged this 17 Jan 18:36
Add support for generic interfaces, i.e. interfaces that accept a type parameter.

For example, you can now have this kind of interface:

```go
type Interface[Kind any] interface {
	DoTheThing() Kind
}
```

and if you run `impl 's StringImpl' 'Interface[string]` it will generate
the following code:

```go
func (s StringImpl) DoTheThing() string {
	// normal impl stub here
}
```

Add a Type abstraction, make type parsing more robust.

Instead of parsing generic types using string manipulation, parse them using the go/parse package to get the AST.

Rather than passing around a type ID and its params everywhere, create a Type struct that contains both.

Fixes josharian/impl#44.

Co-authored-by: Josh Bleecher Snyder <[email protected]>
Assets 2
Loading