You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[INFO] `x` is parsed as a prefix method-call at t.sf line 7
sidef: You're embarrassing me! That's not funny!
File : t.sf
Line : 7 : 6
Error: variable <x> is not declared in the current scope
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.f (x) -> Bool { }
I think the .f in the deparsed is revealing the parser bug; it is parsed as (import ...)->f(x). That's perfectly logical but it's probably not intended.
The imported name does not have to appear anywhere; the import statement alone causes the problem.
If -> f () {} is declared without arguments, then it compiles to Perl without errors, but Perl says Bareword "f" not allowed while "strict subs" in use at (eval 8) line 138.
It behaves the same if the code is not inside a module, but in main scope (but then that requires another file to demonstrate the bug).
It works in any of these separate cases:
f is changed to func f (x) { } while g is still -> g, or
the error is
I think the
.f
in the deparsed is revealing the parser bug; it is parsed as(import ...)->f(x)
. That's perfectly logical but it's probably not intended.The imported name does not have to appear anywhere; the import statement alone causes the problem.
If
-> f () {}
is declared without arguments, then it compiles to Perl without errors, but Perl saysBareword "f" not allowed while "strict subs" in use at (eval 8) line 138.
It behaves the same if the code is not inside a
module
, but inmain
scope (but then that requires another file to demonstrate the bug).It works in any of these separate cases:
f
is changed tofunc f (x) { }
whileg
is still-> g
, orimport
is removed, but theinclude
is keptHere's the full
-Rperl
output: t.pl.txtThe text was updated successfully, but these errors were encountered: