"my" variable $x masks earlier declaration in same scopewarning
Perl supports typed lexical declarations: my Foo $x, my Foo::Bar $x.
The type annotation is stored in the AST and currently ignored at runtime
(in Perl 5, it is used by the deprecated fields pragma for compile-time
hash-key checking via use fields / pseudo-hashes).
- Simple types work when the package is loaded:
my Foo $x✓ - Qualified types work when the package is loaded:
my Foo::Bar $x✓ - Types accepted without requiring package to be loaded ✓
(the type is saved as an AST annotation
"varType"on the declaration node) __PACKAGE__and__CLASS__as type annotations ✓
- Validate the type at runtime (emit a warning/error if the class doesn't exist)
- Support
use fieldspragma for compile-time hash-key checking - Use type annotations for optional JVM type hints or optimization
goto()to jump to a label in the call stack- Thread
- Optimizations
- implement subroutine using JVM Function instead of Method
- Cleanup the closure code to only add the lexical variables mentioned in the AST
- Refactor ScalarSpecialVariable: Override
scalar()to returngetValueAsScalar(), then changeReferenceOperators.ref()to call.scalar()instead of theinstanceof ScalarSpecialVariablecheck. This keeps special handling in the special variable class where it belongs.
- Set up localization in for-loop
- It may need locking when calling ASM
- Ensure GC works for classes