28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9210.9.TypestateErrors<br />

Cannotcoerce:Theoperationrequiresanattributetobedropped, Attributenotpresent:Arequiredtypestateattributewasnotpresent. terminatewithexitstatements.Italsoarisesifyoucodeah<strong>and</strong>ler whichcanneverbebranchedto. Forexample,youcodedaninsertoperationbutthetablewasnot<br />

initialized<strong>and</strong>thesecondtobeuninitialized.SupposeParmsisa butthecoercionwhichdropstheattributewouldalsodropanother attributewhichisrequired.Example: callService(Parms.A,Parms.B); SupposetheinterfacetoServicerequirestherstargumenttobe initialized.<br />

callmessagewhoseminimumtypestaterequiresbothParms.A<strong>and</strong> Parms.Btobeinitialized.ThenthecallstatementrequiresParms.B<br />

Cannotdrop:Thepostconditionrulem<strong>and</strong>atesdroppingthisattribute,buttodosowouldproduceaninvalidtypestate.Forexample,<br />

Cannotadd:Thepostconditionrulem<strong>and</strong>atesaddingthisattribute, thismessage. tobemadeuninitialized,butthiscannotbedonewithoutdiscarding Parms,whichwouldthenmakeParms.Auninitialized. assignmenttoParms.AwithoutrstinitializingParmswouldproduce buttodosowouldproduceaninvalidtypestate.Forexample,an<br />

dependenterrorswhicharedetectedduringtypestatechecking: Thefollowing,whilenottechnicallytypestateerrors,arestaticcontext-<br />

Illegalposition:Youhavecodedthepositionofoperationina Illegalconstant:Youhavecodedastatementwhichmodiesoneof itsoper<strong>and</strong>s,buttheoper<strong>and</strong>isconstant. droppingacallmessagebelowitsminimumtypestate. contextwhereitisnotlegal.Thisoperatorislegalonlywhenthe tableelementoper<strong>and</strong>isaconstantcopy.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!