You need to the following annotation: if :(pss: chss(chss_ilock)) => true then chEvtBroadcastI (pss | inserted_event_p)
If no annotation is given, then the following default is assumed: if :(pss: chss(chss_isr)) => true then chEvtBroadcastI (pss | inserted_event_p) This is due to 'pss' being originally given the type chss(chss_isr) If you do: prval pss2 = pss then the 'original' type for pss2 is chss(chss_isr). So if you use pss2, you do not need to provide an explicit state type annotation. On Sunday, June 12, 2016 at 11:37:13 PM UTC-4, Kiwamu Okabe wrote: > > Hi Hongwei, > > On Sun, Jun 12, 2016 at 9:38 PM, gmhwxi <[email protected] <javascript:>> > wrote: > >>>val () = if true then chEvtBroadcastI (pss | inserted_event_p) > > > > The system does not know what type should be given to pss. You > > need state type annotation: > > > > > https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/ats-lang-users/WfatF27cyDc > > > Sorry. I can't imagine how to apply the state type annotation to my > situation... > Could you show more detail in the example? > > > if chEvtBroachcastI does not change the type of pss, you may just do > > > > prval pss2 = pss > > val () = if true then chEvtBroadcastI (pss2 | inserted_event_p) > > ... > > prval () = (pss := pss2) > > Your code is type-checked. > However, why is renaming pss needed? I think simple renaming is not > hint for ATS2 compiler... > > Best regards, > -- > Kiwamu Okabe at METASEPI DESIGN > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ats-lang-users. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/c93c876f-8630-4b09-91a0-35a573019ac7%40googlegroups.com.
