Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

turip
Copy link

@turip turip commented Aug 1, 2025

This patch fixes issue #3785, where such mixins

func (FooMixin) Fields() []ent.Field {
	return []ent.Field{
		field.String("fooUrl").
			StorageKey("foo_url").
			SchemaType(/* ... */).
			GoType(new(url.URL)).
			ValueScanner(field.BinaryValueScanner[*url.URL]{}),
	}
}

Result in ent/runtime.go:20:17: undefined: userMixinFields0 errors.

Validated against our own codebase and works as expected.

This patch fixes issue ent#3785, where such mixins

```
func (FooMixin) Fields() []ent.Field {
	return []ent.Field{
		field.String("fooUrl").
			StorageKey("foo_url").
			SchemaType(/* ... */).
			GoType(new(url.URL)).
			ValueScanner(field.BinaryValueScanner[*url.URL]{}),
	}
}
```

Result in ent/runtime.go:20:17: undefined: userMixinFields0
@turip
Copy link
Author

turip commented Aug 7, 2025

Added tests, linter passing. Accepted CLA.

@turip
Copy link
Author

turip commented Aug 12, 2025

@a8m could you please take a look at this change?

@mdreizin
Copy link

Hi @a8m, sorry to ping you! When you get a chance, could you review this PR? We’re running into the same issue, and this PR includes a fix. Big thanks to @turip for addressing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants