variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration.
(v *VariableDecl)
| 1198 | |
| 1199 | // variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration. |
| 1200 | func variableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) { |
| 1201 | varType, err := types.TypeToExprType(v.Type()) |
| 1202 | if err != nil { |
| 1203 | return nil, err |
| 1204 | } |
| 1205 | return chkdecls.NewVarWithDoc(v.Name(), varType, v.doc), nil |
| 1206 | } |
| 1207 | |
| 1208 | // FunctionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration. |
| 1209 | func FunctionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) { |
no test coverage detected