Skip to content

[TrimmableTypeMap][Core B] Foundation and AssemblyIndex#10817

Closed
simonrozsival wants to merge 3 commits intodotnet:dev/simonrozsival/ttm-core-a-foundationfrom
simonrozsival:dev/simonrozsival/ttm-core-b-index
Closed

[TrimmableTypeMap][Core B] Foundation and AssemblyIndex#10817
simonrozsival wants to merge 3 commits intodotnet:dev/simonrozsival/ttm-core-a-foundationfrom
simonrozsival:dev/simonrozsival/ttm-core-b-index

Conversation

@simonrozsival
Copy link
Member

@simonrozsival simonrozsival commented Feb 14, 2026

Sliced from #10805
Depends on #10816

Scope

  • Foundation pieces required by scanner (project, model/providers)
  • AssemblyIndex metadata indexing and lookup logic

Notes

  • This keeps scanner indexing concerns isolated from scanner execution flow.

@simonrozsival simonrozsival changed the title [TrimmableTypeMap][Core B] Foundation + AssemblyIndex (<1k) [TrimmableTypeMap][Core B] Foundation and AssemblyIndex Feb 14, 2026
@simonrozsival simonrozsival changed the base branch from main to dev/simonrozsival/ttm-core-a-foundation February 14, 2026 00:19
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// [Export] methods are detected per-method in CollectMarshalMethods
// [Export] methods are not handled yet and supporting them wil be implemented later

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return parentName + "+" + name;
return $"{parentName}+{name}";

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ns + "." + name;
return $"{ns}.{name}";

Comment on lines 389 to 393
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know if this information would be useful later, but it would be useful in tests I think: let's remember the exact type of the attribute please. I think it might be best to make this class abstract and add a sealed subclass for each of the component classes. The ApplicationBackupAgent and ApplicationManageSpaceActivity fields should be just on the ApplicationAttributeInfo class (without the redundant Application prefix).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does typeDef.GetInterfaceImplementations () return only the interfaces implemented on this type level, or also the inherited interfaces? I would expect this API not to recursively explore the interfaces implemented on the base class and the base interfaces of the implemented interfaces. I think we should either not do this yet (we would only support the predefined set of attributes such as [Register], [Application], [Activity], ..., or do it properly and recursively explore the structure. This could be very expensive, so we'd need to carefuly cache if a given type (class or interface) implements IJniNameProviderAttribute. The more I'm thinking about it, the more I think we should not even look for this interface. We can add this logic once we run into a scenario that actually requires it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (attrInfo != null) {
if (attrInfo is not null) {

@simonrozsival simonrozsival added copilot `copilot-cli` or other AIs were used to author this trimmable-type-map Area: CoreCLR Issues that only occur when using CoreCLR. Area: NativeAOT Issues that only occur when using NativeAOT. labels Feb 14, 2026
@simonrozsival
Copy link
Member Author

Addressed all review feedback in this and downstream stacked PRs: applied null patterns (is null/is not null), string interpolation, and split TypeAttributeInfo into typed hierarchy (ActivityAttributeInfo, ServiceAttributeInfo, ApplicationAttributeInfo, etc). All comments can be marked resolved as the code has been updated accordingly.

@simonrozsival simonrozsival force-pushed the dev/simonrozsival/ttm-core-b-index branch 2 times, most recently from 9822cf0 to 2f303ed Compare February 15, 2026 15:37
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/ttm-core-b-index branch from 2f303ed to 4921d7d Compare February 16, 2026 14:48
- Remove IJniNameProviderAttribute discovery and ReclassifyAttributes;
  only support hardcoded known component attributes for now
- Remove JniNameProviderAttributeInfo (unused without dynamic discovery)
- Convert RegisterInfo and ExportInfo to records with required init
- Use .IsNullOrEmpty() extension method instead of string.IsNullOrEmpty()
- Add NullableExtensions.cs for netstandard2.0 nullable-aware string checks
- Throw on unknown component attribute name instead of silently creating
  a JniNameProviderAttributeInfo

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival
Copy link
Member Author

Closing: merged into unified PR #10823. The Core A/B/C split was too granular — a single scanner-core PR is more practical for review while still being much smaller than the original #10805.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CoreCLR Issues that only occur when using CoreCLR. Area: NativeAOT Issues that only occur when using NativeAOT. copilot `copilot-cli` or other AIs were used to author this trimmable-type-map

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments