this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: add missing dereference

While evaluating a value we need to ensure not
to dereference it too much in order not to break
cycle checking. However, in the end we do need
to fully dereference it.

Fixes #4011

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I31d5e9b943b0f1bc840813a36a4efbc49e68f7ee
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1220039
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+1 -62
-62
cue/testdata/eval/deref.txtar
··· 46 46 MisalignedConjunct: 4 47 47 48 48 NumCloseIDs: 2 49 - -- out/evalalpha -- 50 - (struct){ 51 - issue4011: (struct){ 52 - full: (struct){ 53 - let _hugoEnvironments#1 = (struct){ 54 - default: (string){ "_default" } 55 - production: (string){ "production" } 56 - } 57 - site: (struct){ 58 - cls: (struct){ 59 - fs: (struct){ 60 - Create: (_|_){ 61 - // [cycle] cycle error 62 - } 63 - } 64 - hugo: (struct){ 65 - production: (struct){ 66 - } 67 - } 68 - } 69 - } 70 - } 71 - reduced: (struct){ 72 - result: (_|_){ 73 - // [cycle] cycle error 74 - } 75 - envs: (struct){ 76 - foo: (struct){ 77 - } 78 - } 79 - } 80 - } 81 - } 82 - -- diff/-out/evalalpha<==>+out/eval -- 83 - diff old new 84 - --- old 85 - +++ new 86 - @@ -8,11 +8,8 @@ 87 - site: (struct){ 88 - cls: (struct){ 89 - fs: (struct){ 90 - - Create: (struct){ 91 - - config: (struct){ 92 - - Contents: (struct){ 93 - - } 94 - - } 95 - + Create: (_|_){ 96 - + // [cycle] cycle error 97 - } 98 - } 99 - hugo: (struct){ 100 - @@ -23,8 +20,8 @@ 101 - } 102 - } 103 - reduced: (struct){ 104 - - result: (struct){ 105 - - foo: (bool){ true } 106 - + result: (_|_){ 107 - + // [cycle] cycle error 108 - } 109 - envs: (struct){ 110 - foo: (struct){ 111 49 -- out/eval -- 112 50 (struct){ 113 51 issue4011: (struct){
+1
internal/core/adt/context.go
··· 764 764 return v, c.ci 765 765 } 766 766 } 767 + arc = arc.DerefValue() 767 768 v := c.evaluate(arc, x, state) 768 769 769 770 return v, c.ci