Such use of initial types only involves if-expressions and case-expressions.
On Tuesday, June 14, 2016 at 11:49:24 PM UTC-4, Kiwamu Okabe wrote: > > Hi Hongwei, > > On Mon, Jun 13, 2016 at 1:04 PM, gmhwxi <[email protected] <javascript:>> > wrote: > > 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) > > Umm... > The `pss` is introduced as `chss(chss_isr)` at the `tmrfunc` function. > However the `chEvtBroadcastI` function doesn't know that it was > changed into `chss(chss_ilock)`? > If so, how does `chSysUnlockFromISR` function know the changing? > > > 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. > > I think it makes sense. > Does it mean that 'initial' type of linear type is only used in if > expression? > > 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/a8825e33-fc4c-498a-ad01-078c4472043b%40googlegroups.com.
