blob: cbdb2e5f5db5c06e2d57326b123e00e26c084faf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
using System;
using System.Collections.Generic;
public class Foo<T>
{
public abstract class Node
{ }
public class ConcatNode : Node
{ }
public Node GetRoot ()
{
return new ConcatNode ();
}
public void Test (Node root)
{
ConcatNode concat = root as ConcatNode;
Console.WriteLine (concat);
}
}
class X
{
public static void Main ()
{
Foo<int> foo = new Foo<int> ();
Foo<int>.Node root = foo.GetRoot ();
foo.Test (root);
}
}
|