Skip to content

Commit

Permalink
fix: stop using reflect.TypeFor[T]()
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR4N committed Sep 10, 2024
1 parent eadebde commit 0acf40d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion params/config.libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ func (*Extras[C, R]) getter() (g ExtraPayloadGetter[C, R]) { return }

// mustBeStruct panics if `T` isn't a struct.
func mustBeStruct[T any]() {
if k := reflect.TypeFor[T]().Kind(); k != reflect.Struct {
var x T
if k := reflect.TypeOf(x).Kind(); k != reflect.Struct {
panic(notStructMessage[T]())
}
}
Expand Down

0 comments on commit 0acf40d

Please sign in to comment.