-
- Notifications
You must be signed in to change notification settings - Fork 151
Closed
Description
Version: dev-master
Bug Description
The callable definitions introduced in #216 fail to support custom mapped types:
class MappedValues { public string $name; } $form = new Nette\Forms\Form(); $form–>addText('name', 'Name'); $form->setMappedType(MappedValues::class); $form->onSuccess[] = function (Form $form, MappedValues $values) {};produces
Array (array<(callable(Nette\Forms\Form, array): void)|(callable(Nette\Forms\Form, Nette\Utils\ArrayHash): void)>) does not accept Closure(Nette\Forms\Form, MappedValues): void. I don't know how the variance works there, but neither adding callable(Form, object) nor class MappedValues extends ArrayHash seemed to help. Perhaps @ondrejmirtes or @JanTvrdik could chime in please?
Metadata
Metadata
Assignees
Labels
No labels