Daniel Grunwald
b75c252193
Upgrade C# 8.0 nullability support for Roslyn 3.2.0-beta4.
6 years ago
Daniel Grunwald
539e3a906d
Fix #1552 : user-defined and decimal increments
...
For user-defined increments, there were problems with Roslyn was optimizing out one of the stores.
The new transform FixRemainingIncrements now takes increments/decrements that were not detected by TransformAssignment and introduces a temporary variable that can be incremented.
This sometimes requires un-inlining via the new ILInstruction.Extract() operation.
Extract() is not supported in all possible contexts, so it is possible but unlikely that some op_Increment calls remain.
For decimals, the situation is different: legacy csc actually was optimizing "d + 1m" to "op_Increment(d)", so we can get rid of any left-over increments by undoing this optimization. This now happens in ReplaceMethodCallsWithOperators.
6 years ago
Daniel Grunwald
c56714c607
Fix assertion with async lambdas; fix async local functions.
6 years ago
Daniel Grunwald
856cedc95e
#1456 : add test case; add additional checks to ensure we only transform normal locals into using/foreach-locals
6 years ago
Siegfried Pammer
537df7bab3
Add option: 'ref' extension methods
6 years ago
Siegfried Pammer
a109b77858
Refactor LocalFunctionDecompiler to allow mutually recursive local functions to be decompiled correctly.
6 years ago
Siegfried Pammer
763ea38644
Clean up CallBuilder.HandleDelegateConstruction
6 years ago
Siegfried Pammer
37e14f43e3
Refactor/Clean up local functions representation in type system.
6 years ago
Daniel Grunwald
33c7425fa2
Fix several bugs with compound assignments on indexers.
...
Closes #1580 .
6 years ago
Siegfried Pammer
bb066dbd04
Additional test (deactivated)
6 years ago
Siegfried Pammer
01e42b772c
Fix local functions inside lambdas.
6 years ago
Siegfried Pammer
b83cb41f2e
Add pretty tests for local functions.
6 years ago
Siegfried Pammer
89a50e64fc
Extension method syntax on lambda expressions/delegates is not allowed.
6 years ago
Daniel Grunwald
688dffff2b
Add some string.Concat()-tests
6 years ago
Daniel Grunwald
e6489d543e
Fix #1574 : When re-introducing an explicit cast for an implicit user-defined conversion; ensure we use a direct cast and don't go through the code path for builtin conversions.
6 years ago
Daniel Grunwald
3314f3f37a
Fix #1571 : Expression transforms not running for values of inline assignments.
6 years ago
Siegfried Pammer
e99bc2b145
Fix #1567 : Do not transform string.Concat method calls to + operators if named arguments are used.
6 years ago
Siegfried Pammer
0e638dcb28
Fix #1524 : Adjust expression trees transform to work with async code as well.
6 years ago
Daniel Grunwald
04ffdb6da4
Fix 'ref readonly' delegates
6 years ago
Siegfried Pammer
09ea089d8a
Fix #1499 , fix #1502
6 years ago
Siegfried Pammer
983b7e5280
Add test-case for #1462
6 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
6 years ago
Siegfried Pammer
7553c120a5
Fix #1497 : do not insert newlines inside string interpolation expressions.
6 years ago
Siegfried Pammer
8dc80583ec
#1485 : Fix decompilation of TypeAs with Nullable<T> in expression trees
6 years ago
Siegfried Pammer
3abb548e1e
Fix #1479 : Unable to cast object of type 'System.Int32' to type 'System.Single'
6 years ago
Siegfried Pammer
63646b0ace
Fix #1472 : Apply ExpressionTransforms after CombineExitsTransform to "canonicalize logic and/or"
6 years ago
Daniel Grunwald
b7a3c8d640
Fix #1442 : Allow "dynamic?" in the type system.
6 years ago
Daniel Grunwald
8d99af14c5
Add support for 'ref readonly' return type.
6 years ago
Daniel Grunwald
416425b681
Readonly struct method calls on readonly lvalues don't generate temporaries.
6 years ago
Siegfried Pammer
61b170463e
Add missing files.
6 years ago
Daniel Grunwald
4ad4f6a232
Fix #882 : Don't inline value-type temporaries for setter calls.
6 years ago
Daniel Grunwald
a5505ab00d
Expose IMethod.AccessorKind. This makes it easier to determine if a method is a setter, particular in generic classes where "m.AccessorOwner?.Setter == m" ended up being wrong.
6 years ago
Daniel Grunwald
ae2824af99
Fix #617 : Incorrect C# translation when `callvirt` is used to invoke base constructor
6 years ago
Siegfried Pammer
b0309ca9e3
Fix #1180 : Fix generation of Windows Forms InitializeComponent.
6 years ago
Siegfried Pammer
1c261c6170
Optimize ProxyCallReplacer: ignore calls to static methods as those can never be a call to a proxy.
...
Enable FixProxyCalls test for rosyln+opt
6 years ago
Siegfried Pammer
5dfc6132d9
Fix #1443 : ProxyCallReplacer replacing non-proxy-calls with arbitrary calls.
6 years ago
Siegfried Pammer
7671ac6fe4
Fix switch on nullable for Roslyn. Ignore switch on bool because it is indistinguishable from if (bool).
6 years ago
Siegfried Pammer
d42cf99a8c
Fix dynamic transforms because https://github.com/dotnet/roslyn/issues/27800 was fixed.
6 years ago
Daniel Grunwald
72508b5777
Add test for C# 8 nullable reference types; and fix some bugs.
6 years ago
Daniel Grunwald
67124b3b9d
Adjust tests to sorted top-level-types.
6 years ago
Daniel Grunwald
af69c03442
Enable ValueTypes.cs pretty test
6 years ago
Daniel Grunwald
482da77893
Reenable LiftedOperators tests.
6 years ago
Daniel Grunwald
3fac3c07a2
Upgrade Roslyn for tests to 3.0.0-beta3.
...
Remove the committed .il files: these were originally intended to prevent test failures due to differences in the C# compiler on the system.
But legacy csc stopped changing long ago; and roslyn is tested via NuGet package, so everyone is using the same version.
Interestingly enough, avoiding the roundtrip through ildasm/ilasm caused some test failures due to changes in the order of top-level types.
So I've started sorting the types by name to ensure consistency in the tests. This required adjusting some existing tests.
6 years ago
Daniel Grunwald
be1ef7dca2
Re-generate the IL for test cases with Roslyn 2.10.0.
...
The changes to our test runner infrastructure and some cosmetic changes to the test cases caused some minor differences here.
6 years ago
Siegfried Pammer
f05c1bb466
Fix build break; only escape _ if it is a type name. Add basic Discards tests.
6 years ago
Daniel Grunwald
d677ee6254
Escape identifier "_" to avoid ambiguities with discard patterns.
6 years ago
Daniel Grunwald
2f35374d7d
Support "where T : unmanaged" constraints.
6 years ago
Siegfried Pammer
94cd891609
Add support for ReadOnlySpan<T> initialization pattern.
6 years ago
Siegfried Pammer
5962d4675f
Add IL tests for basic isinst patterns. Undo change mentioned in 54ff546221 (commitcomment-32359757)
6 years ago
Siegfried Pammer
545be6d133
Fix CSharpDecompiler.SetNewModifier: follow rules stated in the language specification.
6 years ago