-tcCheckFIType _ arg_tys res_ty (DNImport spec) = do
- checkCg checkDotnet
- dflags <- getDOpts
- checkForeignArgs (isFFIDotnetTy dflags) arg_tys
- checkForeignRes nonIOok (isFFIDotnetTy dflags) res_ty
- let (DNCallSpec isStatic kind _ _ _ _) = spec
- case kind of
- DNMethod | not isStatic ->
- case arg_tys of
- [] -> addErrTc illegalDNMethodSig
- _
- | not (isFFIDotnetObjTy (last arg_tys)) -> addErrTc illegalDNMethodSig
- | otherwise -> return ()
- _ -> return ()
- return (DNImport (withDNTypes spec (map toDNType arg_tys) (toDNType res_ty)))