Sebastien Lebreton
bf4bb1287e
Fix #3821 : keep ref-struct conditional as if/return, not ?. / ?? (CS8978)
...
NullPropagationTransform rewrote `c != null ? c.AccessChain : default` to
`c?.AccessChain ?? default` whenever the access-chain result was a non-nullable
value type. For a by-ref-like type (a ref struct such as Span<T>) that form does
not compile: a ref struct cannot be wrapped in Nullable<T> (CS8978). Exclude
by-ref-like return types from the null-coalescing rewrite.
Assisted-by: Copilot:claude-opus-4.8:GitHub Copilot CLI
2 weeks ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
10 months ago
Siegfried Pammer
d2d9281072
Move CanTransformToExtensionMethodCall to CSharpResolver
11 months ago
Siegfried Pammer
9f77f8a919
Prevent inlining of call arguments when doing so would change order of evaluation with regards to the implicit ldobj performed by a constrained.callvirt.
1 year ago
Siegfried Pammer
9932b5d9f2
Fix #2230 : do not emit directly consecutive null propagation operators.
6 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Daniel Grunwald
2acc4339df
#2058 : Mark most transforms as public to help users that use the ILAst directly without decompiling to C#.
6 years ago
Siegfried Pammer
5711185832
Make sure that the code and the pattern described in the comment above are in sync.
6 years ago
Daniel Grunwald
7d8b9fee1e
Remove redundant code.
6 years ago
Siegfried Pammer
b114734128
Add Mode.UnconstrainedType and implement TransformNullPropagationOnUnconstrainedGenericExpression using TryNullPropagation.
6 years ago
Siegfried Pammer
effc49c479
Move TransformNullPropagationOnUnconstrainedGenericExpression into NullPropagationTransform and make use of IsValidAccessChain
6 years ago
Siegfried Pammer
1303c54086
Exactly match load, store and address counts of defaultTemporary.
6 years ago
Siegfried Pammer
a7d1d8fad7
TransformNullPropagationOnUnconstrainedGenericExpression: handle pattern that uses leave instructions instead of stloc into a temporary.
6 years ago
Siegfried Pammer
010abebcc9
Fix #1050 : Implement TransformNullPropagationOnUnconstrainedGenericExpression
6 years ago
Siegfried Pammer
e211b01595
Fix CA1507:UseNameofInPlaceOfString, adjust formatting of some older source files copied from NRefactory.
7 years ago
Daniel Grunwald
d65b109fbc
Fix #1689 : Add support for null propagation on array access: `arr?[i]`
7 years ago
Daniel Grunwald
80cb24d180
Fix #1709 : NullPropagationTransform.IsGetter on generic types
7 years ago
Daniel Grunwald
57b725df79
Fix #1655 : Incorrect pointer cast when calling method on integer constant
7 years ago
Daniel Grunwald
0e0179edff
Improve NullPropagation (?.) when fields of value-type are involved.
7 years ago
Daniel Grunwald
752f0de978
Further adjustments to transforms now that copy propagation no longer runs.
7 years ago
Daniel Grunwald
72508b5777
Add test for C# 8 nullable reference types; and fix some bugs.
7 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
7 years ago
Daniel Grunwald
ef866040b4
Update to SRM 1.6.0 and Roslyn 2.9. Adjust decompiler to new code pattern used for lifted nullable comparisons.
8 years ago
Daniel Grunwald
12e74daf48
Handle Comp in InferType().
8 years ago
Daniel Grunwald
b396d203bd
Merge IDecompilerTypeSystem with ICompilation.
8 years ago
Daniel Grunwald
3b46776c5e
Rename IAssembly -> IModule.
...
While support for multi-module assemblies isn't fully working yet; it is clear at this point that we want
to treat each module in a multi-module assembly separately for the purposes of the type system.
8 years ago
Siegfried Pammer
cf8bee2c01
Fix translation of generic and extension 'Add' methods in collection initializers.
8 years ago
Daniel Grunwald
6886d2f753
Add support for ?. operator on dynamic.
8 years ago
Daniel Grunwald
21d3881e37
Introduce named arguments only in the statement transform.
...
Don't use extension method syntax when 'this' parameter of
extension method is named.
8 years ago
Siegfried Pammer
61eead50c7
Fix TypeSystemLoaderTests
8 years ago
Siegfried Pammer
1a0052a345
Cache UsingScope during decompiler run.
8 years ago
Siegfried Pammer
8da26dc315
Fix #1080 : Invalid null propagation decompilation with ambiguous extension method call
8 years ago
Daniel Grunwald
4177e182fe
#1050 : Add support for ?. operator applied to ref-parameters, and other cases where the compiler uses a generated ref local for the ?. operator.
...
Still not supported: ?. operator applied to a ref to unconstrained generic type.
8 years ago
Daniel Grunwald
36035de5fa
Improve decompilation of ?. in generic code.
8 years ago
Daniel Grunwald
971e36e7f0
Fix indentation
9 years ago
Daniel Grunwald
3c720b2030
Implement ?. operator when the result of the call is not used
...
For example: "if (x != null) x.M();" -> "x?.M();"
9 years ago
Daniel Grunwald
80a717c090
Fix some bugs in decompilation of ?. operator.
9 years ago
Daniel Grunwald
ca0fa55af8
Implement null propagation transform.
9 years ago