MustAddAssignmentTypeCast registers the given assignment type cast. Panics if an error occurs.
(builtInCasts map[id.Cast]casts.Cast, cast TypeCast)
| 47 | |
| 48 | // MustAddAssignmentTypeCast registers the given assignment type cast. Panics if an error occurs. |
| 49 | func MustAddAssignmentTypeCast(builtInCasts map[id.Cast]casts.Cast, cast TypeCast) { |
| 50 | castID := id.NewCast(cast.FromType.ID, cast.ToType.ID) |
| 51 | if _, ok := builtInCasts[castID]; ok { |
| 52 | panic("duplicate built-in cast") |
| 53 | } |
| 54 | builtInCasts[castID] = casts.Cast{ |
| 55 | ID: castID, |
| 56 | CastType: casts.CastType_Assignment, |
| 57 | Function: id.NullFunction, |
| 58 | BuiltIn: cast.Function, |
| 59 | UseInOut: false, |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // MustAddImplicitTypeCast registers the given implicit type cast. Panics if an error occurs. |
| 64 | func MustAddImplicitTypeCast(builtInCasts map[id.Cast]casts.Cast, cast TypeCast) { |
no test coverage detected