Magento 2: Error during compilation magento 2.2.1

 Custom\Module\Model\ResourceModel\Posts\Grid\Collection
                Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Magento\Store\Model\StoreManagerInterface; File:
D:/wamp/www/smint/magento/app/code/Custom/Module/Model/ResourceModel/Posts/Grid/Collection.php




$connection need to be an instance of \Magento\Framework\DB\Adapter\AdapterInterface, so update your __contruct() like this

public function __construct(
    ...
    \Magento\Framework\DB\Adapter\AdapterInterface  $connection = null,
    ...
) {
    ...
} 

Comments