/*****************************************************************
 ** @author   STF 548
 ** @version  0.0.1
 ** @purpose  1:27.2, Verify that FieldReference can be used to identify a field within a definition
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// The following requirement is tested:
// DefinitionRef and FieldReference identify a definition or field respectively which is within the module, group or
// definition to which the with statement is associated.

module Sem_2702_the_with_statement_003 {

    type component GeneralComp {
	}

	type record R {
		R field optional
	} with { encode(field.field) "RuleA" }

	type record of universal charstring RoUC;

	testcase TC_Sem_2702_the_with_statement_003 () runs on GeneralComp {
		var RoUC v_enc1 := R.field.encode,
			v_enc2 := R.field.field.encode;

		if(lengthof(v_enc1) == 0 and v_enc2[0] == "RuleA") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}


	control{
		execute(TC_Sem_2702_the_with_statement_003());
	}
}