Skip to content

Commit 6d2ac66

Browse files
authored
Clarify "unbound" generic types (#43644)
With C# adding `nameof` support for unbound generic types, it'd be good to explain what _unbound_ means in this doc.
1 parent 3b5a522 commit 6d2ac66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/csharp/advanced-topics/reflection-and-attributes/generics-and-attributes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ helpviewer_keywords:
88
---
99
# Generics and Attributes
1010

11-
Attributes can be applied to generic types in the same way as nongeneric types. However, you can apply attributes only on *open generic types* and *closed constructed generic types*, not on *partially constructed generic types*. An *open generic type* is one where none of the type arguments are specified, such as `Dictionary<TKey, TValue>` A *closed constructed generic type* specifies all type arguments, such as `Dictionary<string, object>`. A *partially constructed generic type* specifies some, but not all, type arguments. An example is `Dictionary<string, TValue>`.
11+
Attributes can be applied to generic types in the same way as nongeneric types. However, you can apply attributes only on *open generic types* and *closed constructed generic types*, not on *partially constructed generic types*. An *open generic type* is one where none of the type arguments are specified, such as `Dictionary<TKey, TValue>` A *closed constructed generic type* specifies all type arguments, such as `Dictionary<string, object>`. A *partially constructed generic type* specifies some, but not all, type arguments. An example is `Dictionary<string, TValue>`. An *unbound generic type* is one where type arguments are omitted, such as `Dictionary<,>`.
1212

1313
The following examples use this custom attribute:
1414

1515
:::code language="csharp" source="./snippets/conceptual/GenericsAndAttributes.cs" id="CustomAttribute":::
1616

17-
An attribute can reference an open generic type:
17+
An attribute can reference an unbound generic type:
1818

1919
:::code language="csharp" source="./snippets/conceptual/GenericsAndAttributes.cs" id="GenericClassAsAttribute":::
2020

0 commit comments

Comments
 (0)