fix: FilterVisibility now applies visibility filter to inherited types (extends)#11043
fix: FilterVisibility now applies visibility filter to inherited types (extends)#11043Copilot wants to merge 8 commits into
Conversation
…s (extends) When filtering a model by visibility, the filter is now also applied to base models in the inheritance chain. This ensures that properties with incompatible visibility in base types are properly filtered out. Closes #11036 Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
…r-visibility Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Done — merged latest from main, added the self-referential model test, verified all 61 visibility tests pass, and confirmed formatting is correct. The diff only contains the 3 expected files. |
…r-visibility Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Done — merged latest main, updated the self-referential test so the target model extends a base with a self-link property, all 61 visibility tests pass, formatting is correct, and the diff contains only the 3 expected files. |
commit: |
|
@copilot, the lint check is failing. You can see the results here: https://github.com/microsoft/typespec/actions/runs/27990186877/job/82845301849?pr=11043 or run pnpm lint to see them. Please pull the latest from main, fix the issue, ensure that all files are correctly formatted and only the changes associated with this pr are in the pr diff. |
…r-visibility Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Fixed — removed 4 unused |
FilterVisibilityonly filtered properties directly on a model but ignoredbaseModel, so inherited properties with incompatible visibility passed through unfiltered.Changes
packages/compiler/src/lib/visibility.ts— IncreateVisibilityFilterMutator'sModel.replacehandler, recursively apply the visibility filter mutator tomodel.baseModelwhen presentpackages/compiler/test/visibility.test.ts— Added test cases covering:applyVisibilityFilterAPI with inheritancenext?: LinkedNode) does not produce infinite regress