Giter Site home page Giter Site logo

Comments (2)

dburgener avatar dburgener commented on August 18, 2024

This is definitely an interaction of two bugs.

  1. Something isn't handled right about aliases in collections, causing the function to incorrectly not be found.
  2. When we're creating a no such function error, we've already discarded Collection specific information. The collection names have become part of their member functions. However, in this case, we don't have a member function, which is why we're making an error. Unfortunately we don't have a list of collections either. We either need to propagate the collection names forward to have them at this error point, or we need to do some sort of fudge like checking all functions or going back to the AST in order to get Collection names at this point. Probably the first is better, but propagating the collection names through cleanly without major refactors isn't particularly trivial. I tried just adding them to the TypeMap, but TypeInfos require TypeDecls and Collections have CollectionDecls instead. That's of course changeable, but the more we change the definition of TypeInfo to accomodate this the more we risk breaking something else. It might be cleaner to just save a list in build_func_map() or extend_type_map(), and pass that through to here, but I haven't looked that through yet.

As you may infer from the above lengths, I've spent most of my time so far on issue 2. I might sit on that for a bit and go back to issue 1 for now. That's arguably more important, and probably an easier fix, although I haven't dug into it too much. I was hoping to fix issue 2 first, so that I could use issue 1 to test it, but issue 2 should be independently testable. Just something like the below should cleanly repro issue 2 regardless of issue 1 being fixed:

collection foo {
    fn func(domain source) {
        allow(source, self, process, signal);
    }
}

domain bar {
    foo.doesnt_exist();
}

from cascade.

dburgener avatar dburgener commented on August 18, 2024

Changed title. #198 should address directly the exact issue originally reported here.

In order to clean up the error message, and handle aliases on collections, we really need to store the list of collections and their aliases somewhere so that we can look back at them later.

from cascade.

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.