Fix resolve declaration internal method

It needs to check throw error for undefined type property of object in $di part