MCPcopy Index your code
hub / github.com/google/mangle / checkStringConstant

Method checkStringConstant

analysis/declcheck.go:118–127  ·  view source on GitHub ↗

Checks that a base term is a string constant.

(baseTerm ast.BaseTerm)

Source from the content-addressed store, hash-verified

116
117// Checks that a base term is a string constant.
118func (c *declChecker) checkStringConstant(baseTerm ast.BaseTerm) {
119 con, ok := baseTerm.(ast.Constant)
120 if !ok {
121 c.errs = append(c.errs, fmt.Errorf("expected string constant, got %v", baseTerm))
122 return
123 }
124 if con.Type != ast.StringType {
125 c.errs = append(c.errs, fmt.Errorf("expected string constant, got %v", c))
126 }
127}

Callers 1

checkMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected