On Fri, Feb 12, 2021 at 7:14 AM xie cui <cuiwei...@gmail.com> wrote:
>
> https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/typecheck.go
> i feel had to understand the param ctxt to typecheck, could you explain to me?

I'm sorry, can you be more specific?  The declaration of typecheck is

func typecheck(n *Node, top int) (res *Node) {

It does not have a param "ctx".

If you are asking about the parameter "top", it holds a bitmask of
values like ctxStmt and ctxExpr.  The bits in the bitmask describing
how the value being type checked (the parameter "n") is being used:
whether it is being used as a statement, as an expression, and so
forth.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUETiDchMF%3DCdCWg3h4odwKWFqMnd6o1TLx%3D%2BSNMPHN2g%40mail.gmail.com.

Reply via email to