next.js
1df28819 - fix(turbo-tasks-macros): Always use the correct trait method in TaskInput (#70812)

Commit
1 year ago
fix(turbo-tasks-macros): Always use the correct trait method in TaskInput (#70812) Without this, method resolution will look for an inherent impl on the type or it autoderefs to first, as inherent impls are preferred over trait methods. For `Vc<T>` this is fine, as the function signature is the same, but for `ResolvedVc<T>`, this causes us to autoderef to `Vc::resolve(...)`, which returns `Vc<T>` instead of `ResolvedVc<T>`. This can lead to confusing error messages inside the macro if you try to `#[derive(TaskInput)]` for a type containing `ResolvedVc<T>`. General best-practice for macros is to be as specific as possible with things like methods.
Author
bgw bgw
Parents
Loading