repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* ResolvedReference.cs (.ctor): Set 'OriginalItemSpec' and 'ResolvedFrom',
[mcs.git]
/
tests
/
gtest-anontype-03.cs
blob
088ddc07043996aaaf0aa962a2f69c7de998b7a0
1
2
// Tests anonymous types initialized with object members
3
using
System
;
4
using
System
.
Collections
;
5
6
public class
MyClass
7
{
8
public string
Foo
=
"Bar"
;
9
public int
Baz
{
10
get
{ return 42; }
11
}
12
}
13
14
public class
Test
15
{
16
static int
Main
()
17
{
18
MyClass mc
=
new
MyClass
();
19
var
v
=
new
{ mc.Foo, mc.Baz }
;
20
21
if
(
v
.
Foo
!=
"Bar"
)
22
return
1
;
23
if
(
v
.
Baz
!=
42
)
24
return
2
;
25
26
return
0
;
27
}
28
}