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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:32:26+00:00 2026-05-13T10:32:26+00:00

If I design a new language with type inference, no explicit types and no

  • 0

If I design a new language with type inference, no explicit types and no class inheritance support and then want to add inheritance, what are the minimum extra hints to the compiler needed to resolve type ambiguity when adding the feature?

Are class names needed?

EDIT

The type-tainting is traced through assignments throughout the program including between functions.

OK in the starting language, you have class names like MyTypeName1 from stuff like:

myVariable1 = New(MyTypeName1)
myVariable2 = New(MyTypeName2)

And types MyTypeName1 and MyTypeName2 are inferred for myVariable1 and myVariable2 respectively. But then if we want to enhance the language to support:

MyVariable3 = myVariable1
MyVariable3 = myVariable2

which can be traced through the code (myVariable3 now can contain two types which presumably are in a hierarchy).

EDIT

The members of MyTypeName1 and MyTypeName2 are inferred from statements like:

myVariable1.name="Fred"
myVariable2.name="JX3009"

What if the name member in MyTypeName1 and in MyTypeName2 are not to be in a common base class? What if we want a different name property in MyTypeName1 and MyTypeName2 and none in a base class? Is there an elegant way to tell the compiler what to do / how to handle? (The idea with type inference is to reduce typing not increase it…?)

Or do we need to specify the hierarchy explicitly?

  • 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-13T10:32:26+00:00Added an answer on May 13, 2026 at 10:32 am

    This field is loaded with undecidability results, but I’ve forgotten them all. If you’re willing to conflate inheritance with subtyping, then you have no problems. If you want something more ambitious (and it sounds as if you do), I’d have a look at

    • Benjamin Pierce’s textbook Types and Programming Languages, which will cover the basic results for width and depth subtyping and how they do or do not play nicely with type inference. (I’d look myself but my copy is at work.)

    • François Pottier’s PhD dissertation.

    Another name to check out is Joe Wells, who’s been responsible for a lot of undecidability results in type systems and programming languages.

    What are the minimum extra hints to the compiler needed to resolve type ambiguity?

    If there is a unique answer to this question, I will be very surprised. I think it far more likely that this is one of those language-design problems where there are a bunch of solutions which are strictly incomparable as far as minimality and annotations go.

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

Sidebar

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.