Пример #1
0
func checkMismatchedTypesGlobal(t1, t2 types.Type, g *ssa.Global) error {
	if !t1.Equals(t2) {
		return &GlobalError{
			Global:  g,
			Message: "Mismatched types: `" + t1.String() + "` and `" + t2.String() + "`",
		}
	}

	return nil
}
Пример #2
0
func errIfMismatchedTypes(t1, t2 types.Type, i ssa.Instruction) error {
	if !t1.Equals(t2) {
		return &InstrError{
			Message: fmt.Sprintf("Mismatched types `%s` and `%s`", t1, t2),
			Instr:   i,
		}
	}

	return nil
}