/***************************************************
 ** @author   TTF T003
 ** @version  0.0.1
 ** @purpose  1:6.3.8, Verify that map types are not compatible if their value types are not compatible
 ** @verdict  pass reject
 ***************************************************/

// The following rule is tested:
// map types are only compatible with other map types. A value "b" of a map type "B" is compatible
// with a map type "A" if the from type of  "A" is compatible with the from type of "B" and the to
// type of "B" is compatible with the totype of "A".

module NegSem_060308_compatibility_of_map_types_003 {
	type record R1 {
		charstring addr,
		integer portVal
	}

	type record R2 {
		charstring id1,
		integer id2 optional
	}
    // R1 and R2 are not compatible, because there's a difference in optionality of the 2nd field
	type map from charstring to R1 TMap1;
	type map from charstring to R2 TMap2;
	type component C {}

	testcase TC_NegSem_060308_compatibility_of_map_types_003() runs on C {
		var TMap1 v_map;
		v_map["HTTP"] := {"127.0.0.1", 80};
		v_map["SSL"] := {"127.0.0.1", 443};
		var TMap2 v_map2 := v_map;
		log(v_map2);
		setverdict(pass);
	}

	control {
		execute(TC_NegSem_060308_compatibility_of_map_types_003());
	}
}
