Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Failed parsing when the parameter type is parenthesized. #416

@Krout0n

Description

@Krout0n

Actual behavior
example.go

package example

type Example interface {
	ParenthesizedParameterType(param (int))
}

Result:
Loading input failed: parenthesized.go:4:28: failed parsing arguments: don't know how to parse type *ast.ParenExpr

Expected behavior
The above codes are accepted.
https://golang.org/ref/spec#Types

Type = TypeName | TypeLit | "(" Type ")" .

Additional Information

  • gomock mode (reflect or source):
  • gomock version or git ref:
$ mockgen -version
-> v1.4.3
  • golang version:
$ go version
-> go version go1.14.1 darwin/amd64

Triage Notes for the Maintainers
I know the linter removes these parentheses. But in case of *(<typename>), it doesn't.
And if this wasn't so hard, I'd be up for the challenge.

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