Add test for ancestor/descendant type-equality constraints#10447
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new test that exercises generic type-equality constraints involving an ancestor (nested) relationship, defining Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/language-feature/generics/type-equality-ancestor-ordering.slang (1)
23-24: Make the two expected failures distinguishable.These two
CHECK_FAIL-DAGlines are identical, so the test can pass without proving thattriggerA<int>()andtriggerB<int>()each failed independently. Please anchor each expectation to its specific instantiation site, or split the two directions into separate tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 14f298e9-d2e6-4e08-af80-1317b32a8eba
📒 Files selected for processing (1)
tests/language-feature/generics/type-equality-ancestor-ordering.slang
There was a problem hiding this comment.
Pull request overview
Adds a new Slang generics regression test to ensure type-equality constraints behave consistently when comparing an enclosing generic type with a nested generic type, regardless of operand order.
Changes:
- Introduces a
CHECK_FAIL-based test coveringBox<X> == Box<X>.Nested<X>and the reversed constraint. - Verifies both instantiations emit the expected diagnostic.
tests/language-feature/generics/type-equality-ancestor-ordering.slang
Outdated
Show resolved
Hide resolved
Add a generics test that exercises equality constraints between nested types and their enclosing type: - Box<X> == Box<X>.Nested<X> - Box<X>.Nested<X> == Box<X>
fdab38b to
7ec29c0
Compare
This comment has been minimized.
This comment has been minimized.
Add a generics test that exercises equality constraints between nested types and their enclosing type: - Box<X> == Box<X>.Nested<X> - Box<X>.Nested<X> == Box<X>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Review: Add test for ancestor/descendant type-equality constraintsClean, minimal test-only PR. LGTM ✅ SummaryAdds a single Verified
|
Add a generics test that exercises equality constraints between nested types and their enclosing type: