Imported Upstream version 4.2.1.36

Former-commit-id: f3008ca867fe7e4b7ae9b9a8844c0ad5798925a9
This commit is contained in:
Xamarin Public Jenkins
2015-09-24 06:06:07 -04:00
committed by Jo Shields
parent afe402035c
commit ea5caba957
172 changed files with 6570 additions and 11015 deletions

View File

@@ -74,6 +74,14 @@ class C
if (res2)
return 17;
var r1 = a_n & E.V;
if (r1 != null)
return 18;
var r2 = E.V & a_n;
if (r1 != null)
return 19;
Console.WriteLine ("ok");
return 0;

View File

@@ -0,0 +1,45 @@
using System;
namespace BrokenOverrideProperty
{
abstract class BaseClass
{
protected BaseClass (string text)
{
Whatever = text;
}
public virtual string Whatever { get; set; }
}
class DerivedClass : BaseClass
{
public string CalledValue;
public DerivedClass (string text) : base (text)
{
}
public override string Whatever {
get {
return "DerivedClass";
}
set {
CalledValue = value;
Console.WriteLine ("set called with {0}", value);
}
}
}
class MainClass
{
public static int Main ()
{
var klass = new DerivedClass ("test-value");
if (klass.CalledValue != "test-value")
return 1;
return 0;
}
}
}

27
mcs/tests/test-927.cs Normal file
View File

@@ -0,0 +1,27 @@
// Compiler options: -unsafe
using System;
class MainClass
{
static int called;
public static double[] GetTempBuffer ()
{
++called;
return new double[4];
}
public static int Main ()
{
unsafe {
fixed (double* dummy = GetTempBuffer()) {
}
}
if (called != 1)
return 1;
return 0;
}
}

View File

@@ -0,0 +1,33 @@
using System;
class X
{
Action<string> a;
public static void Main ()
{
string x = null;
string y = null;
string[] z = null;
x?.Contains (y?.ToLowerInvariant ());
x?.Contains (y?.Length.ToString ());
var res = x?[y?.Length ?? 0];
var res2 = z?[x?.Length ?? 0];
x?.Foo (y?.ToLowerInvariant ());
X xx = null;
xx?.a (y?.ToLowerInvariant ());
}
}
static class E
{
public static string Foo (this string arg, string value)
{
return "";
}
}

View File

@@ -0,0 +1,14 @@
class A
{
public int[] BB;
}
class X
{
public static int Main ()
{
A a = null;
var m = a?.BB?[3];
return 0;
}
}

View File

@@ -0,0 +1,20 @@
using System;
static class MainClass
{
public static void Main()
{
TestBug();
}
public static void TestBug()
{
int? value = null;
value?.Test();
}
public static void Test(this int value)
{
Console.WriteLine("Not null");
}
}

View File

@@ -0,0 +1,34 @@
using static A;
using static B;
class A
{
public class TestMe
{
}
public static int TestMe1 ()
{
return 0;
}
}
class B
{
public static int TestMe2 ()
{
return 0;
}
public class TestMe1
{
}
}
class C
{
public static void Main ()
{
new TestMe1 ();
}
}

View File

@@ -1 +1 @@
41d6ca3b5bbf64d47174ea90dfa15132ba533804
fae778dd6cbda23f819c138a80c2bb28d051aac3