-
Notifications
You must be signed in to change notification settings - Fork 350
Open
Labels
Description
cd ${WORK}/without_alias
exec cue export .
cd ${WORK}/with_alias
exec cue export .
cd ${WORK}/with_aliasv2
exec cue export .
-- without_alias/one.cue --
package p
foo: "foo value"
one_field: foo
-- without_alias/two.cue --
package p
two_field: foo
-- with_alias/one.cue --
package p
A=foo: "foo value"
one_alias: A
one_field: foo
-- with_alias/two.cue --
package p
two_field: foo
-- with_aliasv2/one.cue --
@experiment(aliasv2)
package p
foo~A: "foo value"
one_alias: A
one_field: foo
-- with_aliasv2/two.cue --
@experiment(aliasv2)
package p
two_field: foo
As of 256bd97:
> cd ${WORK}/without_alias
$WORK/without_alias
> exec cue export .
[stdout]
{
"foo": "foo value",
"one_field": "foo value",
"two_field": "foo value"
}
> cd ${WORK}/with_alias
$WORK/with_alias
> exec cue export .
[stderr]
two_field: reference "foo" not found:
./two.cue:3:12
[exit status 1]
FAIL: f.txtar:5: unexpected command failure
> cd ${WORK}/with_aliasv2
$WORK/with_aliasv2
> exec cue export .
[stdout]
{
"foo": "foo value",
"one_alias": "foo value",
"one_field": "foo value",
"two_field": "foo value"
}
This is very odd. Surely, adding an alias to a field declaration should not suddenly change the scope of a field.
Confusingly, this is broken with the current aliases, but works fine with aliasv2. I wonder if this is by accident.
Reactions are currently unavailable