blob: 5bbbffc42f92528905438560b0f18cdffc268828 (
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
33
34
35
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Internal.TypeSystem
{
// Implements canonicalization for generic instantiations
partial class InstantiatedType
{
public override bool IsCanonicalSubtype(CanonicalFormKind policy)
{
foreach (TypeDesc t in Instantiation)
{
if (t.IsCanonicalSubtype(policy))
{
return true;
}
}
return false;
}
protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
{
bool needsChange;
Instantiation canonInstantiation = Context.ConvertInstantiationToCanonForm(Instantiation, kind, out needsChange);
if (needsChange)
{
MetadataType openType = (MetadataType)GetTypeDefinition();
return Context.GetInstantiatedType(openType, canonInstantiation);
}
return this;
}
}
}
|