mirror of
https://github.com/apple/pkl.git
synced 2026-03-25 02:21:11 +01:00
Improve method.isConst() checks in InvokeMethodVirtualNode
- Check `method.isConst()` every time a method is resolved instead of once per node instance (`isConstChecked`). Given that `needsConst` only happens in very specific circumstances, I'm not entirely sure if every resolved method needs to be checked. However, it's a cleaner solution in any case, and `method.isConst()` is a fast check that also never happens on the `evalCached` fast path. - Do not check for const-ness of `FunctionN.apply` methods. This check seems unnecessary and would always fail if triggered. (According to `base.pkl`, none of the `FunctionN.apply` methods is const.) - Remove unnecessary Truffle boundaries for modifier checks, which are just bitwise operations. - Improve const/import docs.
This commit is contained in:
committed by
Daniel Chao
parent
76f1b92039
commit
5de90d5868
@@ -989,8 +989,8 @@ Because a `local` property is added to the lexical scope, but not (observably) t
|
||||
====
|
||||
|
||||
An _import clause_ defines a local property in the containing module.
|
||||
This means `import "someModule.pkl"` is equivalent to `local someModule = import("someModule.pkl")`.
|
||||
Also, `import "someModule.pkl" as otherName` is equivalent to `local otherName = import("someModule.pkl")`.
|
||||
This means `import "someModule.pkl"` is effectively `const local someModule = import("someModule.pkl")`.
|
||||
Also, `import "someModule.pkl" as otherName` is effectively `const local otherName = import("someModule.pkl")`.
|
||||
====
|
||||
|
||||
[[fixed-properties]]
|
||||
|
||||
Reference in New Issue
Block a user