Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot get name of generics in declaration #443

Open
JSAbrahams opened this issue Jan 19, 2023 · 0 comments
Open

Cannot get name of generics in declaration #443

JSAbrahams opened this issue Jan 19, 2023 · 0 comments
Assignees
Labels
bug: check Something in the type check module isn't working (as intended)

Comments

@JSAbrahams
Copy link
Owner

Description of Bug

Currently, no mechanism yet to get generics of declarations.

How to Reproduce

A small example:

class MyClass[T]
    def f(x: T) -> T => x

def x := MyClass[Int]()

Gives an error when trying to process the following in check stage:

def x := MyClass[Int]()

During the generate stage, it correctly identifies this as a function call.
However, the function name is a StringName, and this causes a problem because we call (pseudocode ahead) StringName::try_from(MyClass[Int]).
Because StringName does not know how to deal with Node:Index (which is how it is parsed).

Expected behavior

Should be converted to a StringName.
This should be a quick fix in TryFrom<&AST> for StringName.

Once implemented, then the internal generic logic of check stage which we implemented recently (in part to get collections to work) should take over.

@JSAbrahams JSAbrahams added the bug: check Something in the type check module isn't working (as intended) label Jan 19, 2023
@JSAbrahams JSAbrahams added this to the v0.3.6 | Dictionaries milestone Jan 19, 2023
@JSAbrahams JSAbrahams self-assigned this Jan 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug: check Something in the type check module isn't working (as intended)
Projects
None yet
Development

No branches or pull requests

1 participant