What is the difference between a definition type and a type reference?

I am reading a book CLR via C# Jeffrey Richter.

It Chapter 23(23.3.2)says:"A System.Type object represents a type reference(as opposed to a type definition)."

What does the reference to type and type mean here?

+4
source share
3 answers

The author contrasts System.Typewith System.TypeInfo. From the documentation :

The TypeInfo object represents the type definition itself , while the Type object represents a reference to the type definition .

System.TypeInfo , , ( ), . System.Type, , .

. Type TypeInfo?

+1

, , , .

, . .

System.Type , . typeof(TypeName) object.GetType(), System.Type.

, System.Type. , . .

0

A type definition implies an actual type implementation, for example, if it is a class, it means a class definition (with all its properties and fields).

A reference to a type simply means that it System.Typecontains details of a particular type, that is, it is metadata about the type.

0
source

Source: https://habr.com/ru/post/1683568/


All Articles