(n semantic.Type)
| 1450 | } |
| 1451 | |
| 1452 | func (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 | |
| 1480 | func (e *encoder) uint8Value(n semantic.Uint8Value) (outID uint64) { |
| 1481 | e.build(&e.instances.Uint8Value, e.maps.Uint8Value, n, &outID, func() *Uint8Value { |
no test coverage detected