Closed cqcallaw closed 6 years ago
See also #54
As of this writing, this feature appears to require that Expression::GetTypeSpecifier be revised to return a Result (with potential errors) instead of a TypeSpecifier.
Latest experimentation indicates the Right Thing(tm) appears to be happening. Example:
if (2 == 2) {
b { m:string = "inner" }
r := @b
print(r.m) # works
}
r2 := @b # type error
Given the snippet
It would be reasonable to expect
b
to be undefined outside the context of the body of theif
block. newt currently defines this type in the parent scope, but it is a quirk of the implementation, rather than a considered design decision.