Repository navigation
impact: a C# attribute applied by its short name is a user of its class - #2040
Open
sukuna-in-tech wants to merge 1 commit into
Open
sukuna-in-tech wants to merge 1 commit into
sukuna-in-tech wants to merge 1 commit into
Conversation
…ss (AxiomCodeAI#1127) C# applies RouteAttribute as [Route]: the compiler adds the suffix. The parser records the name as written, so `impact RouteAttribute` found no application at all, and `impact Route` on an unrelated class named Route listed every [Route] as its user. The type reference is now read the way the compiler resolves it: an ATTRIBUTE_TYPE reference [X] names XAttribute when the project declares that class, else X as written. Both the rules' typeref facts and the hook's fast path (graph_sql) apply the same mapping. Before / after on the new case: impact RouteAttribute 0 users -> Api.X, Api.Y, Api.Z impact MarkerAttribute 0 users -> Api (class-level), Api.Y impact Route (control) Router.Make, Router.Use + 2 wrong [Route] rows -> Router.Make, Router.Use only tests/run.py: csharp 352/352 (64 cases), python 483/483; java 378/380 and the surfaces README check fail the same way on dev.
sukuna-in-tech
requested review from
JaredHLZhang,
Whua689,
suyashpaliwal26 and
swapnilpaliwal-sd
as code owners
December 1, 2026 09:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1127 (the impact half: an attribute class now has users).
Problem. C# applies
RouteAttributeas[Route]. The parser stores the name as written, so:impact RouteAttributefound no application: "nothing the graph can see".impact Routeon an unrelated class namedRoutelisted every[Route]as its user (wrong rows).Change. An
ATTRIBUTE_TYPEtype reference[X]namesXAttributewhen the project declares that class, elseX, which is how the compiler resolves it. The same mapping is applied in the rules'typereffacts (axiomcode-impact) and in the hook fast path (graph_sql.py).Tests
impact RouteAttributeimpact MarkerAttributeimpact Route(control, plain class)[Route]rowsNew case
tests/cases/csharp/attribute-application-names-its-class.tests/run.py: csharp 352/352, python 483/483. java 378/380 and thesurfaces.pyREADME check fail identically ondev.Not in this PR: an edge from the application to the attribute's constructor (the other half of #1127).