mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
* error-3.cs: Added testcase for CS0188. svn path=/trunk/mcs/; revision=14670
84 lines
776 B
C#
84 lines
776 B
C#
using System;
|
|
|
|
struct A
|
|
{
|
|
public int a;
|
|
private long b;
|
|
private float c;
|
|
|
|
public A (int foo)
|
|
// CS0171
|
|
{
|
|
a = foo;
|
|
// CS0170
|
|
b = (long) c;
|
|
}
|
|
}
|
|
|
|
struct B
|
|
{
|
|
public int a;
|
|
|
|
public B (int foo)
|
|
{
|
|
// CS0188
|
|
Test ();
|
|
}
|
|
|
|
public void Test ()
|
|
{
|
|
Console.WriteLine (a);
|
|
}
|
|
}
|
|
|
|
class X
|
|
{
|
|
// CS0177
|
|
static void test1 (out A a)
|
|
{
|
|
a.a = 5;
|
|
}
|
|
|
|
static void test_output (A a)
|
|
{
|
|
}
|
|
|
|
static void test2 ()
|
|
{
|
|
A a;
|
|
|
|
// CS0165
|
|
test_output (a);
|
|
}
|
|
|
|
static void test3 ()
|
|
{
|
|
A a;
|
|
|
|
a.a = 5;
|
|
// CS0165
|
|
test_output (a);
|
|
}
|
|
|
|
static void test4 ()
|
|
{
|
|
A a;
|
|
|
|
// CS0170
|
|
Console.WriteLine (a.a);
|
|
}
|
|
|
|
static void test5 (out A a)
|
|
{
|
|
// CS0165
|
|
test_output (a);
|
|
a = new A (5);
|
|
}
|
|
|
|
public static int Main ()
|
|
{
|
|
// Compilation-only test.
|
|
return 0;
|
|
}
|
|
}
|