variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration.
(v *VariableDecl)
| 1014 | |
| 1015 | // variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration. |
| 1016 | func variableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) { |
| 1017 | varType, err := types.TypeToExprType(v.Type()) |
| 1018 | if err != nil { |
| 1019 | return nil, err |
| 1020 | } |
| 1021 | return chkdecls.NewVarWithDoc(v.Name(), varType, v.doc), nil |
| 1022 | } |
| 1023 | |
| 1024 | // FunctionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration. |
| 1025 | func FunctionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) { |
no test coverage detected