Siegfried Pammer
eae54ddf24
Fix #3014 : Missing type information in lambda expressions.
2 years ago
Siegfried Pammer
42668e810a
Fix #2808 : Insert cast to object when statically casting from dynamic to a reference type.
3 years ago
Siegfried Pammer
2de6e1fe30
Ignore nullability annotations when comparing types in the case of implicit conversions.
4 years ago
Daniel Grunwald
47b12a1d9a
Fix #2317 : Crash in ExpressionBuilder.VisitStLoc when storing to a null pointer
4 years ago
Daniel Grunwald
7f985757a7
Fix #2541 : Add explicit `unchecked()` around non-constant cast of constant to `nint`
4 years ago
Siegfried Pammer
280a94ce5d
Fix #1828 , Fix #2290 : Ensure base references have the correct type and are turned into this references and casted if necessary
5 years ago
Daniel Grunwald
8e10ab2d80
Use type hints for pointers.
5 years ago
Siegfried Pammer
b9e4f7df8a
Fix #2202 : prevent casting null to void* if the expected target-type is (U)IntPtr?
5 years ago
Daniel Grunwald
a81714f707
Fix #2180 : Restrict the `(uint?)-1` special case to casts to integer types.
...
This avoids the risk of stack overflows when converting to an unexpected nullable type (such as `Nullable<UnknownType>`).
5 years ago
Daniel Grunwald
5c6b9897c1
Avoid redundant casts + adjust NoExtensionMethods ugly test.
5 years ago
Daniel Grunwald
b8796908f6
Fix some type inference issues with pointer types.
5 years ago
Daniel Grunwald
d13a8bb64d
Support `ldftn` in the context of a function pointer.
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
5 years ago
Daniel Grunwald
156b1d0e75
Fix void*->IntPtr conversion in checked context. Also fix a stack overflow for certain forms of conversions involving `nint`.
6 years ago
Daniel Grunwald
2c9b84a1e1
If possible, use nint/nuint for conversions to/from IntPtr.
6 years ago
Daniel Grunwald
a0b144d332
Use `Unsafe.AsPointer()` for `ConversionKind.StopGCTracking`.
6 years ago
Daniel Grunwald
a9d643b208
Emit a call to `ref Unsafe.As<TFrom, TTo>(ref TFrom)` when the IL code contains a mismatch of managed reference types.
...
The previously emitted `ref *(TTo*)(&source)` only compiles when `source` is a local variable; otherwise C# complains about the memory not being pinned.
Note that we special-case local variables to keep the previous behavior around; this avoids pulling in `System.Runtime.CompilerServices.Unsafe.dll` when it's unnecessary.
6 years ago
Daniel Grunwald
ad5ba9295e
Fix #1924 : preserve hexadecimal format when converting literal to wider type
6 years ago
Daniel Grunwald
968fe1468f
Fix #1747 : Stack overflow when decompiling a `bool` -> `bool?` conversion.
6 years ago
Siegfried Pammer
f0b186c50c
use IdentityConversion instead of IType.Equals.
6 years ago
Daniel Grunwald
1d95eb60a2
Fix #1680 : Invalid cast `(uint?)-1`
6 years ago
Daniel Grunwald
8c4066d471
Fix #1614 : Don't suppress all casts to unknown types
...
Just those where we don't even know the name of the unknown type.
6 years ago
Daniel Grunwald
ab993fc6c6
Fix invalid code generated for impossible casts.
6 years ago
Daniel Grunwald
903544598a
Add comments about expected result after a ConvertTo() call.
...
This method has grown a few cases where it doesn't actually convert.
7 years ago
Siegfried Pammer
36afa0857d
Add tests for ref, out and in parameters.
7 years ago
Siegfried Pammer
9c1bf7fbdf
Introduce ReferenceKind in IParameter and ByReferenceResolveResult.
7 years ago
Daniel Grunwald
b75c252193
Upgrade C# 8.0 nullability support for Roslyn 3.2.0-beta4.
7 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.
7 years ago
Daniel Grunwald
113acd48c1
Improve decompiler behavior is System.ValueTuple exists in multiple referenced assemblies.
...
This can happen if an application is compiled for .NET 4.6.2 and references
System.ValueTuple.dll; but ILSpy loads the latest mscorlib (e.g. .NET 4.7)
which also contains struct System.ValueTuple.
7 years ago
Daniel Grunwald
976565264f
Don't use casts for implicit conversions to bool in conditional contexts.
7 years ago
Daniel Grunwald
b455286ad3
Fix #1333 : Ensure we convert to the correct type when calling instance methods on value types
7 years ago
Daniel Grunwald
3cbadb7134
Fix #1301 : casts were unnecessarily marked as unchecked
7 years ago
Daniel Grunwald
6a417eab97
#1252 : Eliminate more types of redundant casts
7 years ago
Daniel Grunwald
35a0ee2263
Fix #1309 : Decompilation of dynamic casts.
7 years ago
Siegfried Pammer
a9c1b9d515
Fix #1250 : Missing enum to int cast in object initializer
8 years ago
Siegfried Pammer
0fc5c8b988
Add support for FormattableString patterns.
8 years ago
Daniel Grunwald
58b0ddda9e
Add ThrowExpressionConversion.
8 years ago
Andreas Weizel
a254913624
Work for throw expressions.
8 years ago
Daniel Grunwald
5cdd5ecdbc
Use target typing for tuples, where possible.
8 years ago
Daniel Grunwald
d87820e226
Avoid redundant explicit boxing casts
8 years ago
Siegfried Pammer
51549134d6
Do never add casts to 'void'.
8 years ago
Daniel Grunwald
80a717c090
Fix some bugs in decompilation of ?. operator.
8 years ago
Daniel Grunwald
87a03bde70
Add test case for #981 , and fix decompilation of ?: operator on StackType.Ref (necessary to make the testcase compile).
8 years ago
Siegfried Pammer
df04b40951
Fix #990 : Invalid object cast for virtual call through pointer
8 years ago
Siegfried Pammer
049cff2324
Add unit tests, directly use ILFunction instead of NewObj(ILFunction) for expression trees.
8 years ago
Daniel Grunwald
7f7e6564b3
Fix #948 : fix assertion when accessing fixed-size fields where StackType.Ref is expected.
8 years ago
Daniel Grunwald
dd1c509651
Fix #926 : missing explicit casts for implicit operators
8 years ago
Siegfried Pammer
d783fc68ef
Fix #918 : Conversion of bool literals to bool? not pretty
8 years ago
Daniel Grunwald
63493f1fee
#912 : add setting for turning off implicit method group conversions
8 years ago
Daniel Grunwald
b7a5924b25
When possible, use implicit method group conversions to construct delegates.
8 years ago