In class/Microsoft.Build.Tasks:
[mcs.git] / tests / test-535.cs
blobfabf3707e0924420cf71d4b8d1e3f15c2f158180
1 //
2 // Test for conversions that were supposed to be explicit operator
3 // conversions on UIntPtr and IntPtr, but due to historical reasons
4 // ended up in the CSC compiler.
5 //
6 // See bug http://bugzilla.ximian.com/show_bug.cgi?id=59800 for details
7 //
8 // The conversions are:
9 // UIntPtr->SByte
10 // UIntPtr->Int16
11 // UIntPtr->Int32
12 // IntPtr->UInt64
13 // UInt64->IntPtr
14 // SByte->UIntPtr
15 // Int16->UIntPtr
16 // Int32->UIntPtr
18 using System;
19 class X {
20 static void Main ()
22 UIntPtr a = (UIntPtr) 1;
24 // from uintptr
25 sbyte _sbyte = (sbyte) a;
26 short _short = (short) a;
27 int _int = (int) a;
29 // uint64 to intptr
30 IntPtr _intptr = (IntPtr) 1;
31 ulong _ulong = (ulong) _intptr;
33 // to intptr
34 UIntPtr _uptr = (UIntPtr) _sbyte;
35 _uptr = (UIntPtr) _short;
36 _uptr = (UIntPtr) _int;
39 static void Compile ()
41 IntPtr a = (IntPtr) 1;
42 M (a);
45 static void M (long l){}
46 static void M (UInt64 l){}
47 static void M (object o){}