/***************************************************
 ** @author   TTF T003
 ** @version  0.0.1
 ** @purpose  1:6.2.15.7, Verify that an omitted map is properly expanded
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// When referencing an element of an uninitialized map value or field or omitted field (including
// omitting a field at a higher level of the embedding hierarchy) on the left-hand side of an assignment,
// the reference shall recursively be expanded up to and including the depth of the referenced element

module Sem_06021507_referencing_of_elements_002 {
	type record R {
		integer field1,
		integer field2,
		integer field3 optional
	}
	type map from charstring to R TMap1;
	type record MyType {
		TMap1 mapField optional
	}
	type component C {}

	testcase TC_Sem_06021507_referencing_of_elements_002() runs on C {
		var MyType v_val;
		v_val.mapField := omit;
		v_val.mapField["test"].field1 := 1;
		if (not isbound(v_val.mapField["test"].field2) and not ispresent(v_val.mapField["test"].field3)) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}

	control {
		execute(TC_Sem_06021507_referencing_of_elements_002());
	}
}
