-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Description
The issue was introduced with the update from 5.0.3. to 5.0.4.
Setup: Dbus server with some properties of type slice, e.g.:
MyDbusProp: {
Value: []model.MyProp{},
Writable: true,
Emit: prop.EmitTrue,
Callback: func(c *prop.Change) *dbus.Error {
return nil
},
},
On setting the property from server side the following error occurs: error dbus.Store: type mismatch: slice: cannot convert a value of []model.MyProp into []model.MyProp
Patching the the isConvertbileTo function seemd to solve the issue, see the patched function below:
Line 116 in e92e1d8
| func isConvertibleTo(dest, src reflect.Type) bool { |
func isConvertibleTo(dest, src reflect.Type) bool {
switch {
case isVariant(dest):
return true
case dest.Kind() == reflect.Interface:
return true
case dest.Kind() == reflect.Slice:
return src.Kind() == reflect.Slice &&
isConvertibleTo(dest.Elem(), src.Elem())
case dest.Kind() == reflect.Struct:
// return dest.Kind() == src.Kind()
return src == interfacesType || dest.Kind() == src.Kind()
default:
return src.ConvertibleTo(dest)
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels