Skip to content

Who's afraid of the big bad wolf? (v2.28) - #377

Merged
adrianoc merged 78 commits into
mainfrom
v2_28
Sep 18, 2026
Merged

adrianoc merged 78 commits into
mainfrom
v2_28

Conversation

@adrianoc

Copy link
Copy Markdown
Owner

286912a test: ensure all integration/output based tests are configured to run for both Mono.Cecil/System.Reflection.Metadata (#358)
72d668c fix: improves nested type resolution (#358)
bd2720f updates packages Microsoft.CodeAnalysis.CSharp 5.3.0 -> 5.9.0 Microsoft.CodeAnalysis.Common 5.3.0 -> 5.9.0
84405c5 improve guided tour wording and fixes reference dialog not closing
45f450b adds a basic guided tour
4ae05e1 we are in 2026 already :)
dd78c61 targets net10.0
ef17146 feat: coalescing operator support for SRM (#358)
9045543 test: enable/fix TestExpressionBodiedMembers and introduces DisableForContextAttribute (#358)
7ea12a3 test: enable most InvocationTests output based tests on SRM (#358)
e5c0175 test: enable all FieldTests output based tests on SRM (#358)
d4f1732 test: enable all TypeTestCase on SRM (#358)
b707414 fix: use base method in invocations of virtual methods on non value types (#358)
336c9a5 feat: reenabled and fixes ref parameters implementation in SRM (#358)
8553ce2 refact: minor code generation / naming improvements (#358)
8a54211 feat: multiple changes to support a couple of C# statements in SRM (#358)
2094105 fix: use correct size when encoding indexes used in instruction operands (#358)
242f3ab feat: add suport for exception handling in SRM (#358)
25d6d12 refact: ApiDriver required changes to add exception handling support in SRM (#358)
11361a8 test: improve assembly comparison code (#358)
d31f9f0 feat: enables DllImport integration tests on SRM (#358)
495a338 feat: various changes for supporting generic inline arrays and indexing inline arrays through System.Range instances (#358)
f857931 fix: fix invalid code generation in Mono.Cecil and a couple of other issues after the introduction of 'ITypeResolver.MakeGenericInstanceType()' (#358)
9c98727 refact: remove some code duplication (#358)
4ca6a68 refact: more code cleanup
aaaa354 feat: multiple fixes to get 'TestInlineArrays' passing on SRM (#358)
7e95154 feat: introduces 'IMemberResolver.MakeGenericInstanceMethod()' and removes 'MethodExtensions.MakeGenericInstanceMethod()' (#358)
b61d67a fix: issue in which local variables were being added to the incorrect method (#358)
4753af7 feat: take generic type parameters into account when registering/looking up MethodDefinitionVariables (#358)
19e413d refact: code cleanup and minor improvements on debugger visualization for some types (#358)
f43d585 fix: types resolved by 'ITypeResolver.Bcl' needs extra code to be used in System.Reflection.Metadata Api Driver (#358)
0aad861 fix: moves IlContext creation so it can be used when emitting the related method body (#358)
ca9a6d1 doc: improve api docs a little bit
d65ffed feat: introduces ITypeResolver.ResolveTypeParameter() to be used when there's no ITypeSymbol available (#358)
9aea37b fix: call on generic type parameters (#358)
d37ddd8 refact: clean ups a few Mono.Cecil specific code generation, replacing them with ApiDriver abstractions
2d1a115 refact: remove TypeExternsions.MakeByReferenceType() and redirect calls to ITypeResolver.MakeBuyRefType()
8b255b8 test: enables a couple more of low hainging fruits tests (#358)
4e79ea5 test: enables a couple more of low hainging fruits tests (#358)
6d3b641 test: fixes a bunch of either already working or low haiging fruit tests (#358)
7236490 test: fixes a bunch of low haiging fruit tests (#358)
2ae9f7a test: enable tests that got fixed as a side effect of some other change (#358)
eb2dbc8 test: changes tests to allow bypassing context based test filtering
0c9e128 refact: use IlContext instead of strings
178301e refact: remove outdated TODO.
137e64f refact: rename method to match its intent
c4ff012 refact: abstracted away some code that was targeting Mono.Cecil.
4b53171 refact: rephrase comment to improve readbility
b04dd86 refact: change type of variable storing variable name of object abstracting il emiting
d7a485c refact: improved documentation
1eed12b refact: replaced a bunch of hack checks to have different code paths depending on the Api Driver (#368)
29d6ab8 feat: adds support for simple instance/static events to System.Reflection.Metadata Api driver (#368)
3ab97d8 refact: code cleanup
14c5e81 refact: use ApiDriver abstraction instead of assuming Mono.Cecil target in a couple of places (#368)
4415e61 refact: move Utils.EnsureNotNull() method to SyntaxNodeExtensions (#368)
a382cb6 refact: refactoring towards using ApiDriver abstraction instead of assuming Mono.Cecil (#368)
d0f5340 feat: fixes a couple of places in event handling code generation assuming it targes Mono.Cecil (#358)
7f07702 remove failing test included by mistake
34a943b feat: fixes last remaining test for 'value types' handling in System.Reflection.Metadata (#363)
8f98949 test: enables more generic method/property tests and introduces small fix in variable naming when handling properties (#364)
23d9070 fix: various fixes for generic instance methods (#364)
8c4179f fix: use valid identifiers for variable names
2f09c0f test: enables a couple of tests that are passing due to previous changes in generic method handling (#364)
39eb3b8 feat: cache variables holding method instantiations to avoid code duplication (#364)
00c8d3c doc: minor doc improvements (#364)
441e064 feat: fixes generic method handling and enables 'GenericMethods' integration test (#364)
fe113e2 test: enables simple test for generic method invocation (#364)
614ba87 feat: improves generic type parameter resolution and enables related test (#363)
ed79663 refact: code cleanup
bf265d1 fix: invocation of generic methods defined in external assemblies (#364)
18703d3 fix: generic types defined in external assemblies (#363)
88fb877 fix: CoContraVariance tests (partially) under System.Reflection.Metadata (#363)
d5b489e refactor: Renames ITypeResolver.ResolveAny() -> Resolve()
77f90c8 feat: support for generic type parameter constraints on generic types for System.Reflection.Metadata (#363)
4ad467a refact: introduces CecilifierExtensions.AppendEnumFlags() taking Span to minimize heap allocations
e53aa6d refact: code cleanup
256d279 bumps Cecilifier version to 2.28

adrianoc added 30 commits May 31, 2026 12:14
Also renamde original type resolver's ResolveAny() -> ResolveFromAssembly() and moved ResolveAny() implementation to Resolve() method.

This changed the generated code which lead to changes in some test expectation
Invocation of generic methods from external assemblies already works.

Invocation of generic methods defined in the same assembly does not work
(generic method definition is not implemented yet) so the relevant bits
were wrapped to be execised only in Mono.Cecil
In order to enable 'GenericInstanceMethod_ReferencingTypeParametersFromDeclaringType_Works' output test
the following changes were applied:

- Moved CecilDefinitionFactory.InstantiateDelegate() method to 'CodeGenerationHelpers' class

- Label handling in 'CodeGenerationHelpers.InstantiateDelegate()' was assuming Mono.Cecil apis and not
  using ApiDriver apis leading to invalid emitted code.

- Label handling in 'foreach' statements were assuming Mono.Cecil apis and not using ApiDriver apis
  leading to invalid emitted code.

- The fixes for label handling caused unit test expectation changes in 'ForEachStatementTests.Array()'
… fix in variable naming when handling properties (#364)
…tion.Metadata Api driver (#368)

- Adds IApiDriverDefinitionsFactory.Event() and related methods to DelayedDefinitionsManager
- Adds a couple of methods in IILGeneratorApiDriver to emit/mark labels returning the resulting expressions
  (instead of adding them to the output)
- Implemented SystemReflectionMetadataDefinitionsFactory.MethodBody() (required to support events)
- Enables a couple of events integration tests
- Removed a couple of unused parameters methods
basically replaced TODO with an explanation why the code is doing what it is doing
adrianoc added 27 commits June 19, 2026 14:26
…issues after the introduction of 'ITypeResolver.MakeGenericInstanceType()' (#358)
…ng inline arrays through System.Range instances (#358)
which required a lot of refactorings since this area of the code was assuming Mono.Cecil as the
Api Driver target
…nds (#358)

The major offender was the encoding of local variable indexes as 32 bit ints (instead of 16 bits as per specification).

With this fix, many tests that relied on explicity IL expectation were simplified (having a single IL expectation for both
Mono.Cecil and SRM instead of one version for each driver).

Some tests still need dedicated IL expectation for each driver due to differences in the way Specify --help for a list of available options and commands. generates the
decompiled IL (for an unkown reason, generic type parameters from methods are decoded using index syntax instead of
the type parameter name) (maybe we are not emitting correct metadata for the type parameter ?)
…ypes (#358)

When dealling with base/derived types, the code was generating calls to the derived (overriden) method instead of the base one (this should only be applicable to reference
types
this involved removing hardcoded dependencies on Mono.Cecil and fixing a bunch
of test expectations
fixes some problems with nullables that were not reported when targeting net9.0
The tour triggers automatically only once (creates a cookie) but can also be shown through a new button in the page
Microsoft.CodeAnalysis.CSharp 5.3.0 -> 5.9.0
Microsoft.CodeAnalysis.Common 5.3.0 -> 5.9.0

In tests:
coverlet.collector 6.0.4 -> 10.0.1
Microsoft.ILVerification 9.0.0 -> 10.0.12
NSubstitute 5.3.0 -> 6.2.0
Issues were found as a bunch of tests were re-enabled on SRM
… for both Mono.Cecil/System.Reflection.Metadata (#358)

Failing tests have been disabled.

One can easly run all tests by uncomenting the line

//#define RUN_TESTS_ANYWAY

in FilterByContextBase.cs
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.84950% with 77 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.17%. Comparing base (1d9c8dc) to head (286912a).

Files with missing lines Patch % Lines
...TypeSystem/SystemReflectionMetadataTypeResolver.cs 92.44% 6 Missing and 7 partials ⚠️
...ver.SystemReflectionMetadata/DllImportProcessor.cs 80.32% 5 Missing and 7 partials ⚠️
Cecilifier.Core/Extensions/ISymbolExtensions.cs 70.96% 5 Missing and 4 partials ⚠️
...ApiDriver.MonoCecil/MonoCecilDefinitionsFactory.cs 96.66% 1 Missing and 3 partials ⚠️
...er.ApiDriver.MonoCecil/MonoCecilGeneratorDriver.cs 87.87% 4 Missing ⚠️
...data/SystemReflectionMetadataDefinitionsFactory.cs 98.07% 2 Missing and 2 partials ⚠️
...iver.MonoCecil/TypeSystem/MonoCecilTypeResolver.cs 89.65% 1 Missing and 2 partials ⚠️
...etadata/SystemReflectionMetadataGeneratorDriver.cs 89.28% 2 Missing and 1 partial ⚠️
...peSystem/SystemReflectionMetadataMemberResolver.cs 97.47% 1 Missing and 2 partials ⚠️
Cecilifier.Core/Extensions/CecilifierExtensions.cs 85.00% 2 Missing and 1 partial ⚠️
... and 15 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #377      +/-   ##
==========================================
- Coverage   94.37%   94.17%   -0.21%     
==========================================
  Files         143      149       +6     
  Lines       10960    11567     +607     
  Branches     1311     1378      +67     
==========================================
+ Hits        10344    10893     +549     
- Misses        334      344      +10     
- Partials      282      330      +48     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adrianoc
adrianoc merged commit 78f5c44 into main Sep 18, 2026
2 of 3 checks passed
@adrianoc
adrianoc deleted the v2_28 branch September 18, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant