|
|
|
@ -343,11 +343,19 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -343,11 +343,19 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
if (parent is ILiftableInstruction liftable && liftable.IsLifted) { |
|
|
|
|
return true; // inline into lifted operators
|
|
|
|
|
} |
|
|
|
|
if (parent is NullCoalescingInstruction && NullableType.IsNullable(v.Type)) { |
|
|
|
|
return true; // inline nullables into ?? operator
|
|
|
|
|
} |
|
|
|
|
if (parent is NullableUnwrap) { |
|
|
|
|
return true; // inline into ?. operator
|
|
|
|
|
switch (parent.OpCode) { |
|
|
|
|
case OpCode.NullCoalescingInstruction: |
|
|
|
|
if (NullableType.IsNullable(v.Type)) |
|
|
|
|
return true; // inline nullables into ?? operator
|
|
|
|
|
break; |
|
|
|
|
case OpCode.NullableUnwrap: |
|
|
|
|
return true; // inline into ?. operator
|
|
|
|
|
case OpCode.DynamicGetMemberInstruction: |
|
|
|
|
case OpCode.DynamicGetIndexInstruction: |
|
|
|
|
case OpCode.LdObj: |
|
|
|
|
if (parent.Parent.OpCode == OpCode.DynamicCompoundAssign) |
|
|
|
|
return true; // inline into dynamic compound assignments
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
// decide based on the target into which we are inlining
|
|
|
|
|
switch (next.OpCode) { |
|
|
|
|