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

  • Home
  • SEARCH
  • 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 723507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:06:58+00:00 2026-05-14T06:06:58+00:00

I’m a bit boggled by something, I hope the CLR gearheads can help. Apparently

  • 0

I’m a bit boggled by something, I hope the CLR gearheads can help. Apparently my gears aren’t big enough.

I have a reflector utility that generates assembly stubs for Cola for .NET, and I find classes have methods that only differ by a modifier, such as virtual. Example below, from Oracle.DataAccess.dll, method GetType():

class OracleTypeException : System.SystemException {
    virtual  string ToString ();
    virtual  System.Exception GetBaseException ();
    virtual  void set_Source (string value);
    virtual  void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
    virtual  System.Type GetType (); // DeclaringType Exception
    virtual  bool Equals (object obj);
    virtual  int32 GetHashCode ();
    System.Type GetType (); // DeclaringType Object
}

What is this?

I have not been able to reproduce this with C# and it causes trouble for Cola as it thinks GetType() is a redefinition, since the signature is identical.

My method reflector starts like this:

static void DisplayMethod(MethodInfo m)
{
    if (
       // Filter out things Cola cannot yet import, like generics, pointers, etc.
       m.IsGenericMethodDefinition || m.ContainsGenericParameters || m.ReturnType.IsGenericType
       || !m.ReturnType.IsPublic
       || m.ReturnType.IsPointer || m.ReturnType.IsByRef
       || m.ReturnType.IsMarshalByRef
       || m.ReturnType.IsImport
       )
   return;

   // generate stub signature
   // [snipped]
}

SOLVED:
non-virtual GetType() comes from System.Object. The deriving class shadowed System.Object.GetType() with a virtual method.

  • 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-05-14T06:06:58+00:00Added an answer on May 14, 2026 at 6:06 am

    This is possible. Here’s a code snippet that compiles just fine:

    public class OracleTypeException : SystemException, _Exception
    {
        public virtual Type GetType()
        {
            throw new NotImplementedException();
        }
    
        Type _Exception.GetType()
        {
            throw new NotImplementedException();
        }
    }
    

    It relies on the fact that SystemException implements _Exception which itself defines the GetType method. So here we have:

    1. an explicit implementation of this interface
    2. a GetType method that hides the one coming from System.Object.

    By the way the compiler would generate a warning about it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have an array which has BIG numbers and small numbers in it. I
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.