-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18575 from michaelnebel/csharp/overloadresolution
C# 13: Overload resolution priority.
- Loading branch information
Showing
16 changed files
with
1,777 additions
and
1,602 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
csharp/ql/lib/change-notes/2025-01-23-overload-resolution-priority.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
category: minorAnalysis | ||
--- | ||
* C# 13: Added support for the overload resolution priority attribute (`OverloadResolutionPriority`). Usages of the attribute and the corresponding priority can be found using the QL class `SystemRuntimeCompilerServicesOverloadResolutionPriorityAttribute`. |
This file contains 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
This file contains 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
354 changes: 180 additions & 174 deletions
354
csharp/ql/test/library-tests/attributes/AttributeArguments.expected
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
csharp/ql/test/library-tests/attributes/AttributeComments.expected
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
| attributes.cs:11:12:11:24 | [assembly: AssemblyTitle(...)] | attributes.cs:8:1:10:31 | // ... | | ||
| attributes.cs:23:12:23:21 | [assembly: ComVisible(...)] | attributes.cs:20:1:22:58 | // ... | | ||
| attributes.cs:26:12:26:15 | [assembly: Guid(...)] | attributes.cs:25:1:25:84 | // ... | | ||
| attributes.cs:38:12:38:26 | [assembly: AssemblyVersion(...)] | attributes.cs:28:1:37:39 | // ... | | ||
| attributes.cs:12:12:12:24 | [assembly: AssemblyTitle(...)] | attributes.cs:9:1:11:31 | // ... | | ||
| attributes.cs:24:12:24:21 | [assembly: ComVisible(...)] | attributes.cs:21:1:23:58 | // ... | | ||
| attributes.cs:27:12:27:15 | [assembly: Guid(...)] | attributes.cs:26:1:26:84 | // ... | | ||
| attributes.cs:39:12:39:26 | [assembly: AssemblyVersion(...)] | attributes.cs:29:1:38:39 | // ... | |
This file contains 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
4 changes: 2 additions & 2 deletions
4
csharp/ql/test/library-tests/attributes/ExperimentalAttributes.expected
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
| attributes.cs:158:14:158:32 | MyExperimentalClass | attributes.cs:157:2:157:13 | [Experimental(...)] | MyExperimentalClassId | | ||
| attributes.cs:161:17:161:36 | MyExperimentalMethod | attributes.cs:160:6:160:17 | [Experimental(...)] | MyExperimentalMethodId | | ||
| attributes.cs:159:14:159:32 | MyExperimentalClass | attributes.cs:158:2:158:13 | [Experimental(...)] | MyExperimentalClassId | | ||
| attributes.cs:162:17:162:36 | MyExperimentalMethod | attributes.cs:161:6:161:17 | [Experimental(...)] | MyExperimentalMethodId | |
3 changes: 3 additions & 0 deletions
3
csharp/ql/test/library-tests/attributes/OverloadResolutionPriority.expected
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
| attributes.cs:168:17:168:17 | M | attributes.cs:167:6:167:31 | [OverloadResolutionPriority(...)] | -1 | | ||
| attributes.cs:171:17:171:17 | M | attributes.cs:170:6:170:31 | [OverloadResolutionPriority(...)] | 1 | | ||
| attributes.cs:174:17:174:17 | M | attributes.cs:173:6:173:31 | [OverloadResolutionPriority(...)] | 2 | |
7 changes: 7 additions & 0 deletions
7
csharp/ql/test/library-tests/attributes/OverloadResolutionPriority.ql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import csharp | ||
import semmle.code.csharp.frameworks.system.runtime.CompilerServices | ||
|
||
from | ||
Attributable element, SystemRuntimeCompilerServicesOverloadResolutionPriorityAttribute attribute | ||
where attribute = element.getAnAttribute() and attribute.fromSource() | ||
select element, attribute, attribute.getPriority() |
Oops, something went wrong.