From c976ab2eb6c1294cd89fc4476ee35e9677089f58 Mon Sep 17 00:00:00 2001 From: Daniel P H Fox Date: Sat, 19 Aug 2023 19:55:39 +0100 Subject: [PATCH] Clarify how module paths are evaluated --- rfcs/syntax-static-imports.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/syntax-static-imports.md b/rfcs/syntax-static-imports.md index 1de9ffe9..fcf009ac 100644 --- a/rfcs/syntax-static-imports.md +++ b/rfcs/syntax-static-imports.md @@ -46,7 +46,7 @@ local foo = doSomething(require("foo")) -- ok local bar = doSomething(import from "foo") -- not ok ``` -Since this statement will need to be evaluated for the purposes of type autocomplete/inference/etc, the argument *must* be statically evaluatable (as is currently done to provide typechecking for `require()`): +The module path is evaluated at runtime, but is required to be analysable for the purposes of static type checking. Specifically, imports are *not* hardcoded at compile time, because especially in Roblox-like environments, the same code may execute from different locations. ```Lua import from "foo" -- ok