You've already forked linux-packaging-mono
Imported Upstream version 4.2.1.36
Former-commit-id: f3008ca867fe7e4b7ae9b9a8844c0ad5798925a9
This commit is contained in:
committed by
Jo Shields
parent
afe402035c
commit
ea5caba957
@@ -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;
|
||||
|
45
mcs/tests/gtest-autoproperty-20.cs
Normal file
45
mcs/tests/gtest-autoproperty-20.cs
Normal 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
27
mcs/tests/test-927.cs
Normal 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;
|
||||
}
|
||||
}
|
33
mcs/tests/test-null-operator-16.cs
Normal file
33
mcs/tests/test-null-operator-16.cs
Normal 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 "";
|
||||
}
|
||||
}
|
14
mcs/tests/test-null-operator-17.cs
Normal file
14
mcs/tests/test-null-operator-17.cs
Normal 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;
|
||||
}
|
||||
}
|
20
mcs/tests/test-null-operator-18.cs
Normal file
20
mcs/tests/test-null-operator-18.cs
Normal 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");
|
||||
}
|
||||
}
|
34
mcs/tests/test-static-using-11.cs
Normal file
34
mcs/tests/test-static-using-11.cs
Normal 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 ();
|
||||
}
|
||||
}
|
@@ -1 +1 @@
|
||||
41d6ca3b5bbf64d47174ea90dfa15132ba533804
|
||||
fae778dd6cbda23f819c138a80c2bb28d051aac3
|
Reference in New Issue
Block a user