Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8885499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:19:30+00:00 2026-06-14T21:19:30+00:00

I have read the definition of UnderlyingSystemType namely that it Indicates the type provided

  • 0

I have read the definition of “UnderlyingSystemType” namely that it “Indicates the type provided by the common language runtime that represents this type.”

There is a related link on SO at When does the UnderlyingSystemType differ from the current Type instance but I cannot tell from the answers if it is actually at all possible to have an object whose type would be different from the UnderlyingSytemType.

I recently learned about CLS compliance, and that unsigned ints are not CLS compliant. And I was really hopeful that maybe that would do it, that the non-CLS compliant types might have a different underlying type, but that is not the case.

For what it’s worth, the code I used to test is:

Byte    t01 = 1;
SByte   t02 = 1;
Int16   t03 = 1;
UInt16  t04 = 1;
Int32   t05 = 1;
UInt32  t06 = 1;
Int64   t07 = 1;
UInt64  t08 = 1;
Single  t09 = 1;
Double  t10 = 1;
Decimal t11 = 1;
Console.WriteLine(t01.GetType().Equals(t01.GetType().UnderlyingSystemType));
Console.WriteLine(t02.GetType().Equals(t02.GetType().UnderlyingSystemType));
Console.WriteLine(t03.GetType().Equals(t03.GetType().UnderlyingSystemType));
Console.WriteLine(t04.GetType().Equals(t04.GetType().UnderlyingSystemType));
Console.WriteLine(t05.GetType().Equals(t05.GetType().UnderlyingSystemType));
Console.WriteLine(t06.GetType().Equals(t06.GetType().UnderlyingSystemType));
Console.WriteLine(t07.GetType().Equals(t07.GetType().UnderlyingSystemType));
Console.WriteLine(t08.GetType().Equals(t08.GetType().UnderlyingSystemType));
Console.WriteLine(t09.GetType().Equals(t09.GetType().UnderlyingSystemType));
Console.WriteLine(t10.GetType().Equals(t10.GetType().UnderlyingSystemType));
Console.WriteLine(t11.GetType().Equals(t11.GetType().UnderlyingSystemType));

When run, I just get a bunch of trues.

My question is is there a situation in which an underlying system type of an object can be different from its type? And what is the purpose of this distinction, is it merely to allow the definition of hypothetical types that cannot be instantiated? I can’t even create a new Type using the new keyword. And all of the properties of Type are get-only, so I’m lost as to what this feature does. Is the distinction useful in other languages, maybe?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:19:31+00:00Added an answer on June 14, 2026 at 9:19 pm

    Type is an abstract class. The most common implementation you’ll see is RuntimeType, which is what objects typically are, but anyone can create an implementation of Type. RuntimeType‘s UnderlyingSystemType will just return the same RuntimeType. As far as I’ve seen, this is only really significant if you have a method that takes a Type or construct such a type locally, not if you get an object and call GetType. Here’s an example to help you understand:

    class Program
    {
        static void Main(string[] args)
        {
            // creates a type whose methods and properties are all like Int32, but with an UnderlyingSystemType of string
            var type = new MyType(typeof(int));
            Console.WriteLine(type.FullName); // prints System.Int32
            Console.WriteLine(type.UnderlyingSystemType.FullName); // prints System.String
        }
    }
    class MyType : TypeDelegator //this extends Type, which is an abstract class
    {
        public MyType(Type t) : base(t) { }
        public override Type UnderlyingSystemType
        {
            get
            {
                return typeof(string);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does this star unit type works? I have read msdn definition . But
In the database, I have a definition table that is read from the application
First, I must say that I have read several post about this at StackOverflow
ruby newbie alert! (hey that rhymes :)) I have read the official definition but
I have read a bunch of forums on this but none have solved my
I have this definition for my Test class: #ifndef TEST_H #define TEST_H #include <iostream>
I'm new to prototype-based languages and have read this question: Preserving a reference to
I know that this type of question has been asked over and over again,
What are the roots in garbage collection? I have read the definition of root
I have already read Entity Framework One-To-One Mapping Issues and this is not duplicate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.