lang: Make scope error messages be more consistent
This commit is contained in:
@@ -6,4 +6,4 @@ if true {
|
||||
$b = true
|
||||
}
|
||||
-- OUTPUT --
|
||||
# err: errSetScope: variable b not in scope
|
||||
# err: errSetScope: var `$b` does not exist in this scope
|
||||
|
||||
@@ -16,7 +16,8 @@ panic($i0.x != "goodbye")
|
||||
panic($i1.y != "hello")
|
||||
|
||||
# the really tricky case
|
||||
# XXX: works atm, but not supported for now: could not set scope: variable i0.y not in scope
|
||||
# XXX: works atm, but not supported for now, error is:
|
||||
# could not set scope: var `$i0.y` does not exist in this scope
|
||||
# We currently re-export anything in the parent scope as available from our
|
||||
# current child scope, which makes this variable visible. Unfortunately, it does
|
||||
# not have the correct dependency (edge) present in the Ordering system, so it
|
||||
|
||||
@@ -7,4 +7,4 @@ $f = func($x) {
|
||||
$name = $f("foo")
|
||||
test "${name}" {}
|
||||
-- OUTPUT --
|
||||
# err: errSetScope: variable x not in scope
|
||||
# err: errSetScope: var `$x` does not exist in this scope
|
||||
|
||||
@@ -14,7 +14,8 @@ test "${f1.z}" {}
|
||||
test "${f1.x1}" {}
|
||||
|
||||
# the really tricky case
|
||||
# XXX: works atm, but not supported for now: could not set scope: variable f1.x2 not in scope
|
||||
# XXX: works atm, but not supported for now, error is:
|
||||
# could not set scope: var `$f1.x2` does not exist in this scope
|
||||
# We currently re-export anything in the parent scope as available from our
|
||||
# current child scope, which makes this variable visible. Unfortunately, it does
|
||||
# not have the correct dependency (edge) present in the Ordering system, so it
|
||||
|
||||
@@ -11,4 +11,4 @@ $x = "this is x.mcl"
|
||||
import "x.mcl" as f
|
||||
$y = $f.x + " and this is y.mcl"
|
||||
-- OUTPUT --
|
||||
# err: errSetScope: variable g.x not in scope
|
||||
# err: errSetScope: var `$g.x` does not exist in this scope
|
||||
|
||||
Reference in New Issue
Block a user