Fixed checking of signal source type in connect method

This commit is contained in:
Michał Derkacz
2011-09-21 23:06:45 +02:00
parent d80fb2adea
commit f39cefba66

View File

@@ -225,6 +225,11 @@ param0 interface{}) {
if noi { if noi {
// There is no instance on which signal was emited as first parameter // There is no instance on which signal was emited as first parameter
poffset-- poffset--
} else if !o.Type().Match(ft.In(poffset - 1)) {
panic(fmt.Sprintf(
"Callback #%d param. type %s doesn't match signal source: %s",
poffset-1, ft.In(poffset-1), o.Type(),
))
} }
n_params := int(sq.n_params) n_params := int(sq.n_params)
if ft.NumIn() != n_params+poffset { if ft.NumIn() != n_params+poffset {
@@ -242,7 +247,7 @@ param0 interface{}) {
if !pt[i].Match(ft.In(i + poffset)) { if !pt[i].Match(ft.In(i + poffset)) {
panic(fmt.Sprintf( panic(fmt.Sprintf(
"Callback #%d param. type %s doesn't match signal spec %s", "Callback #%d param. type %s doesn't match signal spec %s",
i+1, ft.In(i+poffset), pt[i], i+poffset, ft.In(i+poffset), pt[i],
)) ))
} }
} }