Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Lib.hs:4:17: error: [GHC-39999]
## Explanation

Sometimes, when GHC encounters a type error, it suggests solving
it from an unexpected end. In this case, when it encouters a literal
it from an unexpected end. In this case, when it encounters a literal
instead of a list, it does not just complain about it. Instead it suspects
that maybe an author meant to overload numeric literals so that they can mean lists too.

Expand Down
8 changes: 8 additions & 0 deletions message-index/messages/GHC-58481/example6/after/CAPI.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{-# LANGUAGE CApiFFI #-}

module CAPI where

import Foreign.C

foreign import capi "setenv"
c_setenv :: CString -> CString -> CInt -> IO CInt
6 changes: 6 additions & 0 deletions message-index/messages/GHC-58481/example6/before/CAPI.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module CAPI where

import Foreign.C

foreign import capi "setenv"
c_setenv :: CString -> CString -> CInt -> IO CInt
13 changes: 13 additions & 0 deletions message-index/messages/GHC-58481/example6/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Use of `capi` calling convention
---

In this example the user attempted to use `capi` calling convention for foreign imports without enabling the `CApiFFI` extension, which leads to this generic parsing error.

```
CAPI.hs:5:16: error: [GHC-58481]
parse error on input ‘capi’
|
5 | foreign import capi "setenv"
| ^^^^
```