Skip to content

Filter members inherited from custom base types#11078

Merged
JoshLove-msft merged 1 commit into
mainfrom
live1206/mtg-custom-base-type
Jun 24, 2026
Merged

Filter members inherited from custom base types#11078
JoshLove-msft merged 1 commit into
mainfrom
live1206/mtg-custom-base-type

Conversation

@live1206

@live1206 live1206 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Filter generated properties and fields that are inherited from a selected custom base type provider.
  • Resolve custom base types from referenced assemblies through Roslyn symbols so inherited members are represented by normal providers.
  • Add a regression test for a model with a TypeSpec base whose custom partial changes the base to a system type.

Validation

  • dotnet test packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Microsoft.TypeSpec.Generator.Tests.csproj --filter "FullyQualifiedName~CanCustomizeBaseModel|FullyQualifiedName~CanCustomizeSpecBaseModelToSystemType" --no-restore

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jun 24, 2026
@live1206 live1206 force-pushed the live1206/mtg-custom-base-type branch from 7f1f373 to a45df5c Compare June 24, 2026 07:55
@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@11078

commit: 32a1cc3

@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@live1206 live1206 force-pushed the live1206/mtg-custom-base-type branch 2 times, most recently from 7aec589 to f1b1dd7 Compare June 24, 2026 08:09
@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@live1206 live1206 marked this pull request as ready for review June 24, 2026 08:12
Avoid emitting duplicate generated properties or fields when custom partial code changes a model base type to a type that already exposes those members.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@live1206 live1206 force-pushed the live1206/mtg-custom-base-type branch from f1b1dd7 to 32a1cc3 Compare June 24, 2026 08:49
@live1206

Copy link
Copy Markdown
Contributor Author

No diff in regen: Azure/azure-sdk-for-net#60188

@JoshLove-msft JoshLove-msft added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 1e1d1b3 Jun 24, 2026
29 checks passed
@JoshLove-msft JoshLove-msft deleted the live1206/mtg-custom-base-type branch June 24, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants