(node checker.AstNode, defaultVal uint64)
| 67 | } |
| 68 | |
| 69 | func nodeAsUintValue(node checker.AstNode, defaultVal uint64) uint64 { |
| 70 | if node.Expr().Kind() != ast.LiteralKind { |
| 71 | return defaultVal |
| 72 | } |
| 73 | lit := node.Expr().AsLiteral() |
| 74 | if lit.Type() != types.IntType { |
| 75 | return defaultVal |
| 76 | } |
| 77 | val := lit.(types.Int) |
| 78 | if val < types.IntZero { |
| 79 | return 0 |
| 80 | } |
| 81 | return uint64(lit.(types.Int)) |
| 82 | } |
| 83 | |
| 84 | func callEstimate(cost checker.CostEstimate, sz *checker.SizeEstimate) *checker.CallEstimate { |
| 85 | return &checker.CallEstimate{CostEstimate: cost, ResultSize: sz} |
no test coverage detected