/*****************************************************************
 ** @author   STF 521
 ** @version  0.0.2
 ** @purpose  1:22.3.4, incompatible template in the from clause of the getreply operation
 ** @verdict  pass reject
 *****************************************************************/

// The following requirements are tested:
// f) All AddressRef items in the from clause and all VariableRef items in the sender clause
// shall be of type address, component or of the address type bound to the port type (see
// section 6.2.9) of the port instance referenced in the getcall operation.

module NegSem_220304_getreply_operation_021 {

	signature S() return integer;

	type port P procedure {
		inout S;
	}

    type component GeneralComp {
		port P p;
	}

	function f() runs on GeneralComp {
        p.getcall(S:{});
        p.reply(S:{} value 1);
	}

    testcase TC_NegSem_220304_getreply_operation_021() runs on GeneralComp system GeneralComp {
        var charstring v_addr := "addr";
        var GeneralComp v_ptc := GeneralComp.create;
		connect(self:p, v_ptc:p);
		v_ptc.start(f());
		p.call(S:{}) {
            [] p.getreply(S:?) from v_addr {} // error expected
            [] p.getreply {}
        }
        setverdict(pass);
    }

    control {
        execute(TC_NegSem_220304_getreply_operation_021(), 5.0);
    }
}