#name: detectIncompleteYAML
#evalFull
-- in.cue --
package foobar

import yaml "encoding/yaml"

#Spec: {
	_vars: {something: string}
	data: {
		#foo: {
			use: _vars.something
		}
		baz:    yaml.Marshal(_vars.something)
		foobar: yaml.Marshal(#foo)
	}
}
Val: #Spec & {
	_vars: something: "var-string"
}
-- out/def --
package foobar

import "encoding/yaml"

#Spec: {
	_vars: {
		something: string
	}
	data: {
		#foo: {
			use: _vars.something
		}
		baz:    yaml.Marshal(_vars.something)
		foobar: yaml.Marshal(#foo)
	}
}
Val: #Spec & {
	_vars: {
		something: "var-string"
	}
}
-- out/export --
Val: {
	data: {
		baz: """
        var-string
        
        """
		foobar: """
        use: var-string
        
        """
	}
}
-- out/yaml --
Val:
  data:
    baz: |
      var-string
    foobar: |
      use: var-string
-- out/json --
{"Val":{"data":{"baz":"var-string\n","foobar":"use: var-string\n"}}}
-- out/legacy-debug --
<0>{#Spec: <1>C{_vars: <2>C{something: string}, data: <3>C{#foo: <4>C{use: string}, baz: <5>.Marshal (<6>._vars.something), foobar: <5>.Marshal (<7>.#foo)}}, Val: <8>C{_vars: <9>C{something: "var-string"}, data: <10>C{#foo: <11>C{use: "var-string"}, baz: "var-string\n", foobar: "use: var-string\n"}}}
-- out/eval/stats --
Leaks:  0
Freed:  17
Reused: 12
Allocs: 5
Retain: 0

Unifications: 17
Conjuncts:    32
Disjuncts:    17
-- out/eval --
(struct){
  #Spec: (#struct){
    _vars(:foobar): (#struct){
      something: (string){ string }
    }
    data: (#struct){
      #foo: (#struct){
        use: (string){ string }
      }
      baz: (_|_){
        // [incomplete] #Spec.data.baz: non-concrete argument 0:
        //     ./in.cue:11:11
      }
      foobar: (_|_){
        // [incomplete] #Spec.data.foobar: error in call to encoding/yaml.Marshal: incomplete value string:
        //     ./in.cue:12:11
        //     ./in.cue:6:21
      }
    }
  }
  Val: (#struct){
    _vars(:foobar): (#struct){
      something: (string){ "var-string" }
    }
    data: (#struct){
      #foo: (#struct){
        use: (string){ "var-string" }
      }
      baz: (string){ "var-string\n" }
      foobar: (string){ "use: var-string\n" }
    }
  }
}
-- out/compile --
--- in.cue
{
  #Spec: {
    _vars: {
      something: string
    }
    data: {
      #foo: {
        use: 〈2;_vars〉.something
      }
      baz: 〈import;"encoding/yaml"〉.Marshal(〈1;_vars〉.something)
      foobar: 〈import;"encoding/yaml"〉.Marshal(〈0;#foo〉)
    }
  }
  Val: (〈0;#Spec〉 & {
    _vars: {
      something: "var-string"
    }
  })
}
