summaryrefslogtreecommitdiff
path: root/tests/src/JIT/opt/Inline/DelegInstanceFtn.cs
blob: 72d72e37ebd62356f690970126002a2b25d15465 (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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using System;

class Test
{
    delegate object MyDeleg(string s);

    object f2(string s)
    {
        if (s == "test2")
            return 100;
        else
            return 1;
    }

    public static int Main()
    {
        Test t = new Test();
        MyDeleg d2 = new MyDeleg(t.f2);
        return Convert.ToInt32(d2("test2"));
    }
}