variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration.
(v *VariableDecl)
| 1110 | |
| 1111 | // variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration. |
| 1112 | func variableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) { |
| 1113 | varType, err := types.TypeToExprType(v.Type()) |
| 1114 | if err != nil { |
| 1115 | return nil, err |
| 1116 | } |
| 1117 | return chkdecls.NewVarWithDoc(v.Name(), varType, v.doc), nil |
| 1118 | } |
| 1119 | |
| 1120 | // FunctionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration. |
| 1121 | func FunctionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) { |
no test coverage detected