I'm getting following errors on running setup:di:compile in my magento 2.
Incompatible argument type: Required type: \Magento\Catalog\Model\ProductTypes\ConfigInterface. Actual type: array;
Incompatible argument type: Required type: \Magento\Wishlist\Model\WishlistFactory. Actual type: array;
Code responsible for the error is as follows
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Backend\Model\Session\Quote $sessionQuote,
\Magento\Sales\Model\AdminOrder\Create $orderCreate,
PriceCurrencyInterface $priceCurrency,
\Magento\Wishlist\Model\WishlistFactory $wishlistFactory,
\Magento\GiftMessage\Model\Save $giftMessageSave,
\Magento\Tax\Model\Config $taxConfig,
\Magento\Tax\Helper\Data $taxData,
\Magento\GiftMessage\Helper\Message $messageHelper,
StockRegistryInterface $stockRegistry,
StockStateInterface $stockState,
array $data = []
) {
$this->_messageHelper = $messageHelper;
$this->_wishlistFactory = $wishlistFactory;
$this->_giftMessageSave = $giftMessageSave;
$this->_taxConfig = $taxConfig;
$this->_taxData = $taxData;
$this->stockRegistry = $stockRegistry;
$this->stockState = $stockState;
parent::__construct($context, $sessionQuote, $orderCreate, $priceCurrency, $data);
}
And
public function __construct(
\Magento\Backend\Block\Context $context,
\Magento\Catalog\Model\ProductTypes\ConfigInterface $typeConfig,
array $data = []
) {
parent::__construct($context, $data);
$this->typeConfig = $typeConfig;
}
In my Layout I'm calling like this
<block class="MyVendor\MyModule\Block\Adminhtml\Quote\Create\Items" template="Magento_Sales::order/create/items.phtml" name="items">
<block class="Magento\Sales\Block\Adminhtml\Order\Create\Items\Grid" template="Magento_Sales::quote/create/items/grid.phtml" name="items_grid">
<block class="Magento\Sales\Block\Adminhtml\Order\Create\Coupons" template="Magento_Sales::order/create/form.phtml" name="coupons">
<block class="Magento\Sales\Block\Adminhtml\Order\Create\Coupons\Form" template="Magento_Sales::order/create/coupons/form.phtml" name="form" />
</block>
</block>
</block>
Thanks in Advance