MCPcopy Create free account
hub / github.com/google/gapid / ty

Method ty

gapil/bapi/encode.go:1452–1478  ·  view source on GitHub ↗
(n semantic.Type)

Source from the content-addressed store, hash-verified

1450}
1451
1452func (e *encoder) ty(n semantic.Type) *Type {
1453 if isNil(n) {
1454 return nil
1455 }
1456 switch n := n.(type) {
1457 case *semantic.Builtin:
1458 return &Type{Ty: &Type_Builtin{e.builtin(n)}}
1459 case *semantic.Class:
1460 return &Type{Ty: &Type_Class{e.class(n)}}
1461 case *semantic.Enum:
1462 return &Type{Ty: &Type_Enum{e.enum(n)}}
1463 case *semantic.Map:
1464 return &Type{Ty: &Type_Map{e.map_(n)}}
1465 case *semantic.Pointer:
1466 return &Type{Ty: &Type_Pointer{e.pointer(n)}}
1467 case *semantic.Pseudonym:
1468 return &Type{Ty: &Type_Pseudonym{e.pseudonym(n)}}
1469 case *semantic.Reference:
1470 return &Type{Ty: &Type_Reference{e.reference(n)}}
1471 case *semantic.Slice:
1472 return &Type{Ty: &Type_Slice{e.slice(n)}}
1473 case *semantic.StaticArray:
1474 return &Type{Ty: &Type_StaticArray{e.staticArray(n)}}
1475 default:
1476 panic(fmt.Errorf("Unhandled type %T", n))
1477 }
1478}
1479
1480func (e *encoder) uint8Value(n semantic.Uint8Value) (outID uint64) {
1481 e.build(&e.instances.Uint8Value, e.maps.Uint8Value, n, &outID, func() *Uint8Value {

Callers 15

arrayInitMethod · 0.95
binaryOpMethod · 0.95
callMethod · 0.95
castMethod · 0.95
enumMethod · 0.95
fieldMethod · 0.95
globalMethod · 0.95
lengthMethod · 0.95
localMethod · 0.95
map_Method · 0.95
nullMethod · 0.95
paramMethod · 0.95

Calls 10

builtinMethod · 0.95
classMethod · 0.95
enumMethod · 0.95
map_Method · 0.95
pointerMethod · 0.95
pseudonymMethod · 0.95
referenceMethod · 0.95
sliceMethod · 0.95
staticArrayMethod · 0.95
isNilFunction · 0.70

Tested by

no test coverage detected