MCPcopy
hub / github.com/expr-lang/expr / derefParam

Method derefParam

compiler/compiler.go:1325–1335  ·  view source on GitHub ↗
(in reflect.Type, param ast.Node)

Source from the content-addressed store, hash-verified

1323}
1324
1325func (c *compiler) derefParam(in reflect.Type, param ast.Node) {
1326 if param.Nature().Nil {
1327 return
1328 }
1329 if param.Type().AssignableTo(in) {
1330 return
1331 }
1332 if in.Kind() != reflect.Ptr && param.Type().Kind() == reflect.Ptr {
1333 c.emit(OpDeref)
1334 }
1335}
1336
1337func (c *compiler) optimize() {
1338 for i, op := range c.bytecode {

Callers 1

CallNodeMethod · 0.95

Calls 4

emitMethod · 0.95
AssignableToMethod · 0.80
NatureMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected