mirror of
https://github.com/apple/pkl.git
synced 2026-04-18 14:39:54 +02:00
Require references from typealiases to be const (#516)
This adds a language change that requires references from typealiases to the enclosing module to be `const`. This is required because typealiases are not late-bound. Rationale is laid out in SPICE-0007. Also: * Update documentation to reflect new rules. * Fix `Project.pkl`; mark method `const` to not break said rule.
This commit is contained in:
@@ -221,7 +221,7 @@ function newInstance(enclosingModule: Module): Project = new {
|
||||
projectFileUri = reflect.Module(enclosingModule).uri
|
||||
}
|
||||
|
||||
local hasVersion = (it: Uri) ->
|
||||
const local hasVersion = (it: Uri) ->
|
||||
let (versionSep = it.lastIndexOf("@"))
|
||||
if (versionSep == -1) false
|
||||
else let (version = it.drop(versionSep + 1))
|
||||
|
||||
Reference in New Issue
Block a user