Skip to content
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

fix(compiler): Nested abilities [fixes LNG-214] #816

Merged
merged 15 commits into from Jul 31, 2023

Conversation

DieMyst
Copy link
Member

@DieMyst DieMyst commented Jul 27, 2023

No description provided.

@linear
Copy link

linear bot commented Jul 27, 2023

LNG-214 Compiler fails on nested ability function call

On such a code snippet:

data Struct:
    int: i8

ability Simple:
    st: Struct
    arrow(x: i8) -> bool

ability Complex:
    simple: Simple
    field: string

func foo{Complex}() -> bool:
    <- Complex.simple.arrow(
        Complex.simple.st.int
    )

func main() -> bool:

    closure = (x: i8) -> bool:
        <- x > 0

    MyComplex = Complex(
        simple = Simple(
            st = Struct(int = 0),
            arrow = closure
        ),
        field = "complex"
    )

    <- foo{MyComplex}()

Compiler errors internally:

ApplyPropertiesRawInliner.scala [ERROR] Inlining, cannot find field Complex.simple in ability var{Complex: scope Complex{field: string, simple: scope Simple{arrow: (x: i8) :: ∅ -> bool :: ∅, st: Struct{int: i8}}}}.. Available: Set(PARTICLE_TTL, PARTICLE_TIMESTAMP, nil, INIT_PEER_ID, HOST_PEER_ID, LAST_ERROR)

@DieMyst DieMyst added the e2e Run e2e workflow label Jul 27, 2023
@DieMyst DieMyst closed this Jul 27, 2023
@DieMyst DieMyst reopened this Jul 27, 2023
@DieMyst DieMyst closed this Jul 28, 2023
@DieMyst DieMyst reopened this Jul 28, 2023
@DieMyst DieMyst closed this Jul 28, 2023
@DieMyst DieMyst reopened this Jul 28, 2023
@InversionSpaces InversionSpaces self-requested a review July 31, 2023 09:20
@DieMyst DieMyst merged commit 4e3e70f into main Jul 31, 2023
10 checks passed
@DieMyst DieMyst deleted the LNG-214-nested-abilities-bug branch July 31, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants