New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate type definitions for 'list<action>' functions #667
Comments
I was having a think about what the implementation would look like for a syntax like account.listKeys(). That'll require a few changes to consume the work that @jorgecotillo did for namespaces, and if possible, I'd like to share logic with namespace function resolution. Some things I noticed which I think may need to change to support this:
My thoughts for changes required to Bicep:
|
I'm not sure I understand why functions and overloads must be modeled as types. |
Function resolution will depend on the type of the parent, so the function resolution logic can't happen at name binding time (where it is today). This only works for namespaces because we have pre-existing mapping from name -> namespace. |
I understand that we need to have object types that have functions and functions have return types, but functions themselves aren't types. It seems that after the name binding visitor is done, the type assignment visitor could add additional bindings for instance functions. (Technically the whole name binding logic could probably be moved into the type assignment visitor to make it deferred, but that's probably not required.) |
Maybe I am not understanding something but in TypeAssignmentVisitor FunctionSymbols return a TypeSymbol (return type of the function), which I think makes sense because a function itself is not a type is a symbol that returns some type. Is the proposal to defer the lookup of functions to TypeAssignmentVisitor? |
Yup, exactly this. Functions will need to be defined in the type system (although not directly as types to Marcin's point), rather than assigned directly to symbols. |
Makes sense |
This is done |
Support one of the following syntaxes:
or
The text was updated successfully, but these errors were encountered: