Skip to content

Document hoisting semantics #62

@mkhan45

Description

@mkhan45

Right now, this example prints 106:

z = 3
f = x -> x + y + z
y = 5
z = 100

println (f 1)  --  106

z is marked as resolved and f captures its reference, so it later evaluates to 100 when f is called. y is properly hoisted such that it evaluates to 5 in the closure.

Instead, this should be a compile time failure since z is marked as immutable by f's capture.

Discord thread: https://discordapp.com/channels/651996477333438474/730624907607539722/904815689154564227

Metadata

Metadata

Assignees

Labels

documentationNeeded documentation or quidequestionQuestion asking for help or clarification

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions