/***************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:22.2.2, Ensure that the referenced value associated with ValueRef or the return type associated with FunctionInstance followed
by the receive keyword, shall be of a port type.
 ** @verdict  pass reject
 ***************************************************/

// The following requirements are tested:
/* Restriction n) The referenced value associated with ValueRef or the return type associated with FunctionInstance followed
 * by the receive keyword, shall be of a port type.
 * */

module NegSem_220202_ReceiveOperation_026 {


    type port loopbackPort message {
	  inout integer
	}

    function f_port() return charstring{
        var charstring v_p := "not a port";
        return v_p;
    }


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_NegSem_220202_ReceiveOperation_026() runs on GeneralComp {
     messagePort.send(2);

    alt {
     [] f_port().receive(1) {   // error: shall be of a port type.
         setverdict(pass);
     }

    }
}

control{
 execute(TC_NegSem_220202_ReceiveOperation_026());
}

}
