mirror of https://github.com/icsharpcode/ILSpy.git
5 changed files with 67 additions and 3 deletions
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness |
||||
{ |
||||
class DynamicTests |
||||
{ |
||||
delegate void RefAction<T>(ref T arg); |
||||
|
||||
static void Main(string[] args) |
||||
{ |
||||
PrintResult((ref dynamic x) => x = x + 2.0, 5.0); |
||||
PrintResult((ref dynamic x) => x = x + 2.0, 5); |
||||
PrintResult((ref dynamic x) => x = x + 2, 5.0); |
||||
PrintResult((ref dynamic x) => x = x + 2, 5); |
||||
PrintResult((ref dynamic x) => x = x - 2.0, 5.0); |
||||
PrintResult((ref dynamic x) => x = x - 2.0, 5); |
||||
PrintResult((ref dynamic x) => x = x - 2, 5.0); |
||||
PrintResult((ref dynamic x) => x = x - 2, 5); |
||||
PrintResult((ref dynamic x) => x = x * 2.0, 5.0); |
||||
PrintResult((ref dynamic x) => x = x * 2.0, 5); |
||||
PrintResult((ref dynamic x) => x = x * 2, 5.0); |
||||
PrintResult((ref dynamic x) => x = x * 2, 5); |
||||
PrintResult((ref dynamic x) => x = x / 2.0, 5.0); |
||||
PrintResult((ref dynamic x) => x = x / 2.0, 5); |
||||
PrintResult((ref dynamic x) => x = x / 2, 5.0); |
||||
PrintResult((ref dynamic x) => x = x / 2, 5); |
||||
} |
||||
|
||||
private static void PrintResult(RefAction<dynamic> p, dynamic arg) |
||||
{ |
||||
p(ref arg); |
||||
Console.WriteLine(arg); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue