fix: error when a mixin call is used as a property value - #4478
Conversation
Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe declaration evaluator now reports an error when a mixin used as a property value evaluates to an array, and a regression fixture records the expected syntax error. ChangesMixin property-value validation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Using a mixin call directly as a property value (without a lookup) silently
emitted
[object Object]:The mixin call resolves to its ruleset, which reaches the declaration as an
array of rules and renders as
[object Object].Declaration.evalalreadyrejects a
DetachedRulesetused on a property with "Rulesets cannot beevaluated on a property."; this extends that same guard to the array case, so
the mistake surfaces as a clear error instead of invalid output.
Only non-variable (property) declarations are affected, so valid uses such as
#ns.mixin()[@var]lookups, statement mixin calls, and passing a ruleset toeach()are unchanged. Added an eval-error test;pnpm testpasses.Closes #4305
Summary by CodeRabbit
[object Object].