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 9212577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:33:21+00:00 2026-06-18T01:33:21+00:00

I have the following 2 overloaded staic methods defined in my static Class: private

  • 0

I have the following 2 overloaded staic methods defined in my static Class:

private static Dictionary<int, PartitionDefinition> GetNewPartitionDefinitions (string  measureGroup, int rangeThreshold)
    {
         do something;
}
private static Dictionary<int, PartitionDefinition> GetNewPartitionDefinitions(DateRange startDateRange)
{
do something else;
}

The behavior I’m getting is which ever method is listed first in the code is the one that is recognized during design-time. The subsequent method name in the chain gets greyed out and I if I hover over it I receive the message ‘Method is never used’.

I have also noted that if I attempt to call the method, intellisense only detects the first one appearing in the code, like the other doesn’t exist.

Researching the problem I “believe” I can eliminate the condition of Type Erasure as being the issue but I’m not 100% absolutely certain of this.

I do know that the following code would constitute valid for Type Erasure using Generics:

public class A {
 public static MethodOne  (List<String> param) {}
 public static MethodOne  (Dictionary<String,String> param) {}
}

But in this case, the generics are being passed as parameters so I can see how this would cause a problem. In my instance, only the return types are identical Generic types but one would think that having the same method name and clearly having different non-generic parameter types and number should work.

Could someone please shed a bit of light on this? I have looked at similar article postings here, but none of them seem to describe the precise problem I am seeing.

I am not new to programming but I don’t claim to know everything and this one is a first for me.

  • 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-18T01:33:22+00:00Added an answer on June 18, 2026 at 1:33 am

    The Message you receive might be because you are not using the methode in your code, the issue to overload static methods is actually allowed and shouldnt be a problem or cause any compiler error, you may want to check your configuration for the warnings and hints in VS.

    I just tested it using this code:

    public static class TestClass
        {
            public static string stat(string measureGroup, int rangeThreshold)
            {
                return "st1";
            }
    
            public static string stat(int startDateRange)
            {
                return "st2";
            }
    
            private testmethode()
            {
               // string h = TestClass.stat(.... at this point i get both variants offered)
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: class Program { static void Main(string[] args) { Test
I have the following method: public static string UlList(this HtmlHelper helper, List<IEntity> entities, string
Class: Class: private: ... vector<string> words; vector< list<int> > vints; public: myFunction(...) I am
Let's say I have the following method: public static int CountNonNullMembers<T>(this IEnumerable<T> enumerable) {
I have the following functions: public static V AddIfNotPresent<K, V>( this Dictionary<K, V> store,
I have the following code: class Sales_item { public: int ii; Sales_item& operator=(const Sales_item
Say I have an overloaded extension method with the following two signatures: public static
There is a static class Pipe, defined in C++ header that I'm including. The
In the following code, i have an overloaded method, one that takes a parameter
I have the following class declaration: public class EntityTag : BaseEntity, ITaggable I have

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.