GithubHelp home page GithubHelp logo

Comments (1)

mrkmarron avatar mrkmarron commented on May 20, 2024 1

Thanks for the very useful bug report. There were a couple of things going on here. One of them was fixed in PR #371 and there is a parser issues I opened bug #372.

The expected result of your example is the type error since you have 2 possible resolutions of the static call -- Foo::ala and Bar::ala. We check that there is only 1 unique resolution of the call. So, the following would be ok:

concept Foo {
    static ala(a: Int): Int {
        _debug("Called Foo::ala");
        return a;
    }
}

concept Bar {
}

entrypoint function main(): Int {
   return Foo&Bar::ala(1);
}

In this case there is only 1 possible resolution -- namely Foo::ala.

This isn't too useful when dealing with explicit types since you could just write Foo::ala instead. However, it can be very convenient when dealing with template instantiation:

function baz<T>(a: Int): Int {
   return T::ala(a);
}

In this case we want to be able to call baz<Foo&Bar>(3) instead of having to ensure that each template type that may be used in a static resolution is unique. Similarly we should also allow cases like:

entity E provides Foo {
}

entrypoint function main(): Int {
   return E::ala(1);
}

In this case we resolve the correct static member from the derived type instead of requiring the developer to use the exact concept type that specifies the static member.

I am merging PR #371 which should get this working but please repoen if there are other issues or questions.

from bosquelanguage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.