-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: error when enum and useUnderlyingTypeMethods conflict
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
input: | ||
input.go: | | ||
package example | ||
|
||
// goverter:converter | ||
// goverter:extend ConvertUnderlying | ||
type Converter interface { | ||
// goverter:useUnderlyingTypeMethods | ||
Convert(SqlColor) Color | ||
} | ||
|
||
func ConvertUnderlying(s string) string { | ||
return "" | ||
} | ||
|
||
type SqlColor string | ||
const SqlColorDefault SqlColor = "default" | ||
|
||
type Color string | ||
const ColorDefault Color = "default" | ||
error: |- | ||
Error while creating converter method: | ||
func (github.com/jmattheis/goverter/execution.Converter).Convert(github.com/jmattheis/goverter/execution.SqlColor) github.com/jmattheis/goverter/execution.Color | ||
|
||
| github.com/jmattheis/goverter/execution.SqlColor | ||
| | ||
source | ||
target | ||
| | ||
| github.com/jmattheis/goverter/execution.Color | ||
|
||
The conversion between the types | ||
github.com/jmattheis/goverter/execution.SqlColor | ||
github.com/jmattheis/goverter/execution.Color | ||
|
||
does qualify for enum conversion but also match an extend method via useUnderlyingTypeMethods. | ||
You have to disable enum or useUnderlyingTypeMethods to resolve the setting conflict. |