/***************************************************
 ** @author   548
 ** @version  0.0.1
 ** @purpose  1:6.2, assignment notation for record values containing union with @default
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// using the @default modifier before the type of the alternative. For unions with a default alternative, special type compatibility rules apply (see clause 6.3.2.4) which allow using the union value as compatible with the type of the default alternative.

module Sem_060201_RecordTypeValues_005 {

type component GeneralComp {
}

 type record R {
  integer f1,
  U f2
 }

 type union U {
		@default integer option1,
		charstring option2
 }


testcase TC_Sem_060201_RecordTypeValues_005() runs on GeneralComp {

 var R v_assigned := { 1, 2 };	// implicit usage of default modifier in f2
 if (match(v_assigned.f1, 1) and match(v_assigned.f2, 2)) {
		setverdict(pass);
	} else { setverdict(fail); }
}

control {
    execute(TC_Sem_060201_RecordTypeValues_005());
}

}
