Siegfried Pammer
aa147870a2
Fix #2389 : missing extern keyword for properties and events.
4 years ago
Daniel Grunwald
bd9aabeae2
Update to dotnet-format 5.1.225507.
...
This makes the formatting expected by our CI consistent with that generated by VS2019.9.
4 years ago
Daniel Grunwald
1292ff70d9
Fix #2391 : mark method as unsafe when passing `null` to a parameter of pointer type.
4 years ago
Daniel Grunwald
aae27900dc
Fix #2398 : TranslateCondition: truncate condition value if necessary
4 years ago
Daniel Grunwald
8d70d63dba
#2392 : Avoid some redundant casts with the `?:` operator.
4 years ago
Siegfried Pammer
3f721a17c1
Add support for System.Runtime.CompilerServices.SpecialNameAttribute
4 years ago
Siegfried Pammer
7211587b45
Fix #2366 : NRE in AwaitInCatchTransform.MatchAwaitCatchHandler() and pattern errors when dealing with a switch-based jump table in AwaitInCatchTransform
4 years ago
Siegfried Pammer
76227af89d
Fix #1749 , fix #2339 , fix #2353 : Add support for rethrow in async exception handlers, fix await catch/finally patterns for complex methods.
4 years ago
Siegfried Pammer
d2fc380e0e
Fix #2349 : Use proper ExpressionType with DynamicCompoundAssign.
4 years ago
Siegfried Pammer
4ae41a855e
Fix #2321 : Missing readonly modifier for ref local
4 years ago
Siegfried Pammer
bdff99170c
#1828 : Add test case
4 years ago
Daniel Grunwald
f2d3f259fd
#2311 : Adjust test case for #1292 -- fixed statement is now correctly detected
4 years ago
Daniel Grunwald
51b3cf51c6
Fix #2305 : Cast to integer type where necessary in managed pointer arithmetic.
5 years ago
Daniel Grunwald
b4c5c0d212
Fix #2287 : Prefer `ref target.field[0]` over `ref *target.field`
5 years ago
Daniel Grunwald
281586de1f
`#enable nullable` for a couple of files.
...
Includes some fixes for potential NullReferenceExceptions.
5 years ago
Siegfried Pammer
3b2f00e44f
Add test case.
5 years ago
Daniel Grunwald
3c554b5e6c
Fix overload resolution: overloads with `in` parameters are applicable even if the argument is passed without explicit `in`
5 years ago
Daniel Grunwald
514cf9b03b
Fix #1944 : Add support for implicit conversions with `in` parameters.
5 years ago
Siegfried Pammer
fdda8abd74
Fix #2282 : Finalizers must be void and cannot be declared in interfaces
5 years ago
Siegfried Pammer
f29205448b
Fix #2283 : Disallow all implicit conversions in switch on string.
5 years ago
Siegfried Pammer
63ca748b9a
Fix #2283 : string.to.int instruction entails a conversion to string of the input value
5 years ago
Daniel Grunwald
6951ccb1a2
Fix #2260 : switch(string) transform: handle empty cases where the C# compiler optimizes out the `if`
...
e.g.
```
switch (<PrivateImplementationDetails>.ComputeStringHash(text2))
{
case 1288728352u:
_ = text2 == "rowno";
break;
...
```
5 years ago
Siegfried Pammer
f52ce79da0
Fix #2278 : Implement support for CSharpBinderFlags.InvokeSimpleName
5 years ago
Siegfried Pammer
a5858f1694
Add support for primary constructor syntax.
5 years ago
Siegfried Pammer
cc19e9043e
Fix #603 : Single element arrays should not span multiple lines
...
Fix #1079 : CSharpFormattingOptions.AutoPropertyFormatting has no effect
5 years ago
Siegfried Pammer
3df82cf33b
Add support for 'with' expressions
5 years ago
Daniel Grunwald
be9871981a
Records: Detect compiler-generated Equals() in derived records.
5 years ago
Daniel Grunwald
d9874380cd
Records: support generic records
5 years ago
Daniel Grunwald
0bf6d552e0
Records: support for fields.
5 years ago
Daniel Grunwald
a960216d5f
Add test case for simple records.
5 years ago
Siegfried Pammer
cfaf6cc93f
Fix #2222 : switch-expression does not support implicit conversions.
5 years ago
Daniel Grunwald
411457c4c7
#1240 : Add support for Unsafe comparison intrinsics: `AreSame`, `IsAddressLessThan`, `IsAddressGreaterThan`
5 years ago
Daniel Grunwald
6e8c1b3117
ILReader: support comparison between StackType.Ref and StackType.I
...
Update Unsafe.il tests to .NET 5.0 version.
5 years ago
Daniel Grunwald
782e4ae88c
Fix #2215 : Use `Unsafe` intrinsics for `ldobj`/`stobj` instructions.
...
Use `Unsafe.As` to adjust the type of a managed reference if necessary (without converting to a pointer type).
This also adds support for the `ReadUnaligned`/`WriteUnaligned` intrinsics.
5 years ago
Daniel Grunwald
54231edb4b
Fix #2189 : Invalid C# generated when pinning an unmanaged pointer.
...
C# has some special rules for allowed expressions inside a fixed statement.
In the non-allowed cases, emit an `Unsafe.AsRef()` call to prevent compiler errors.
5 years ago
Siegfried Pammer
b9e4f7df8a
Fix #2202 : prevent casting null to void* if the expected target-type is (U)IntPtr?
5 years ago
Siegfried Pammer
d3b0e4cd72
Fix #2196 : Add support for extern local functions.
5 years ago
Siegfried Pammer
3a7c69e5b9
Fix #2192 : Add support for VB.NET delegate construction
5 years ago
Siegfried Pammer
be57dc454c
Run tests with different versions of Roslyn
5 years ago
Daniel Grunwald
80cf72e498
#2182 : Move "Transform call to struct constructor" from EarlyExpressionTransforms to ILReader.
...
This fixes the evaluation order for such calls (and an assertion in StObj.CheckTargetSlot).
5 years ago
Daniel Grunwald
47685c4b57
Fix weird casts to `nint` when writing to fields of unknown type.
5 years ago
Daniel Grunwald
6010757d22
Add support for .NET 5 custom calling conventions.
5 years ago
Daniel Grunwald
836bc37050
Upgrade ilasm.exe version. This allows us to write tests for the new function pointer calling conventions.
5 years ago
Daniel Grunwald
03787bfc70
Avoid parentheses around lambdas where possible.
5 years ago
Siegfried Pammer
e5b0004d1c
Fix build
5 years ago
Siegfried Pammer
8e9ecf6c36
Fix #2162 : handle VariableInitializers like AssignmentExpressions in InsertParenthesesVisitor
5 years ago
Daniel Grunwald
63d1f5bb09
Adjust old `calli` test case to new function pointer syntax
5 years ago
Daniel Grunwald
6d3239678c
Function pointers: add support for the builtin unmanaged calling conventions.
5 years ago
Daniel Grunwald
9381be2280
#2158 : Fix decompilation of arithmetic on managed pointers after ConversionKind.StartGCTracking.
5 years ago
Daniel Grunwald
a26a25d689
Fix #2158 : Remove PointerType support from CSharpResolver for additions/subtractions.
...
These have special semantics (number of elements in C# vs. number of bytes in IL), and so pointer arithmetic must go through the special HandlePointerArithmetic() code path --> the normal logic in HandleBinaryNumeric must not ever emit pointer arithmetic.
5 years ago