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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:58:57+00:00 2026-05-13T16:58:57+00:00

I’ve got an interface inheritance issue that has been vexing me for some time.

  • 0

I’ve got an interface inheritance issue that has been vexing me for some time. It doesn’t seem to make any sense, and I can only conclude that I’m missing something fundamental.

Overview

The code below is from part of a fluent interface for our ORM tool. It provides a SQL-like syntax for pulling data from the database. You don’t have to completely grok all the interrelations to understand the problem — the real issue is the EndClause method.

The EndClause Issue

There’s a method called EndClause that doesn’t show up in one expected spot — IOrderQueryRoot. As far as I know, it should show up because it inherits from two different interfaces that both have a method called EndClause, but when I consume an object that implements IOrderQueryRoot, EndClause does not pop up in intellisense.

There are some more implementation details below.

First though, if you look at IOrderQueryRoot (which contains EndClause), you can see that it inherits IHasOrderLogicalOperators, and also IHasOrderFields (which also contains EndClause).

Public Interface IHasOrderLogicalOperators
    Function [And]() As IHasOrderFields
    Function [AndNot]() As IHasOrderFields
    Function [Not]() As IHasOrderFields
    Function [Or]() As IHasOrderFields
    Function [OrNot]() As IHasOrderFields

    Function EndClause() As IHasOrderLogicalOperators
End Interface

Public Interface IHasOrderFields
    Function OrderID(ByVal value As Int32) as IHasOrderLogicalOperators
    Function OrderID() As IHasOrderComparisonOperators
    Function PracticeID(ByVal value As Int32) as IHasOrderLogicalOperators
    Function PracticeID() As IHasOrderComparisonOperators
    'note: I cut about a page of additional order-related fields you don't need to see.

    Function BeginClause() As IHasOrderFields
    Function EndClause() As IHasOrderLogicalOperators
End Interface

Public Interface IOrderQueryRoot
    Inherits IHasOrderFields, IHasOrderLogicalOperators

End Interface

I think the problem must have something to do with the fact that the EndClause method comes into IOrderQueryRoot twice from different places in the inheritance chain. It does need to work that way.

Since you might want to see the place where I actually consume the interfaces, here’s the code I’m using:

    Public Function EndClause() As IHasOrderLogicalOperators Implements IHasOrderFields.EndClause, IHasOrderLogicalOperators.EndClause
        Me.Query.EndClause()

        Return New OrderQueryElement(Query)
    End Function

At this point, the interface is working fine — if I were to remove this method, VS would scream that I have to implement both EndClause methods. The problem is one level down, when the “end developer” is trying to actually write code against the interface.

Please let me know if something jumps out at you — this one has been driving me crazy for a long time!

  • 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-13T16:58:57+00:00Added an answer on May 13, 2026 at 4:58 pm

    The reason why this doesn’t exist in Intellisense is that calling the function EndClause via the interface IOrderQueryRoot is illegal and results in a compiler error. The reason why is it’s not possible to distinguish from the following code if you should call IHasOrderLogicalOperators.EndClause or IHasOrderFields.EndClause.

    Dim v1 As IOrderQueryRoot
    v1.EndClause()
    

    Intellisense strives to only suggest legal code. This code is not legal and hence it is not listed.

    Yes, in your implementation of IOrderQueryRoot the resolution is unambiguous as there is a single function. For the raw IOrderQueryRoot though this resolution is ambiguous and hence correctly not listed.

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

Sidebar

Related Questions

No related questions found

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.