Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BaseTypeRuntimeInterfacesAlgorithm.cs « Common « TypeSystem « Common « tools « coreclr « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 41ff1102a8ed6dbe9ac710964713235a3c9a3254 (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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Debug = System.Diagnostics.Debug;

namespace Internal.TypeSystem
{
    /// <summary>
    /// RuntimeInterfaces algorithm for types known to have no explicitly defined interfaces
    /// but which do have a base type. (For instance multidimensional arrays)
    /// </summary>
    public sealed class BaseTypeRuntimeInterfacesAlgorithm : RuntimeInterfacesAlgorithm
    {
        private static RuntimeInterfacesAlgorithm _singleton = new BaseTypeRuntimeInterfacesAlgorithm();

        private BaseTypeRuntimeInterfacesAlgorithm() { }

        public static RuntimeInterfacesAlgorithm Instance
        {
            get
            {
                return _singleton;
            }
        }

        public override DefType[] ComputeRuntimeInterfaces(TypeDesc _type)
        {
            return _type.BaseType.RuntimeInterfaces;
        }
    }
}