projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
do not check order sequence if option /order was not used
[mono.git]
/
mcs
/
tests
/
gtest-anontype-02.cs
1
2
// Tests anonymous types initialized with local variables
3
using System;
4
using System.Collections;
5
6
public class Test
7
{
8
static object TestA (string s)
9
{
10
return new { s };
11
}
12
13
static int Main ()
14
{
15
string Foo = "Bar";
16
int Baz = 42;
17
var v = new { Foo, Baz };
18
19
if (v.Foo != "Bar")
20
return 1;
21
if (v.Baz != 42)
22
return 2;
23
24
if (!TestA ("foo").Equals (new { s = "foo" }))
25
return 3;
26
27
Console.WriteLine ("OK");
28
return 0;
29
}
30
}