Hotfix for miscompilation in lambdas that return lambdas
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a0554d0d2e
commit
523509d300
|
@ -1,11 +1,14 @@
|
||||||
|
|
||||||
var i = 0
|
var printer = lambda (pfx):
|
||||||
|
return lambda (msg):
|
||||||
let pr = lambda (str):
|
@print("This is a func call")
|
||||||
@print("This is a func call")
|
@print(msg)
|
||||||
@print(str)
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
let pr = printer("This is a func call")
|
||||||
|
var i = 0
|
||||||
|
|
||||||
pr("")
|
pr("")
|
||||||
|
|
||||||
while i < 5:
|
while i < 5:
|
||||||
|
|
|
@ -673,8 +673,6 @@ pub const Tree = struct {
|
||||||
|
|
||||||
switch (self.tokenizer.token) {
|
switch (self.tokenizer.token) {
|
||||||
.keyword_return => {
|
.keyword_return => {
|
||||||
defer self.tokenizer.skip_newlines();
|
|
||||||
|
|
||||||
if (self.has_returned) {
|
if (self.has_returned) {
|
||||||
return self.report("multiple returns in lambda scope but expected only one");
|
return self.report("multiple returns in lambda scope but expected only one");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue