Ensure that Any is Boxed in FFI imports/exports
We should only accept the type `Any` in foreign import/export declarations when it has type `Type` or `UnliftedType`. This patch adds a kind check, and a special error message triggered by occurrences of `Any` in foreign import/export declarations at other kinds. Fixes #21305
Showing
- compiler/GHC/Tc/Errors/Ppr.hs 3 additions, 0 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Utils/TcType.hs 41 additions, 9 deletionscompiler/GHC/Tc/Utils/TcType.hs
- docs/users_guide/exts/ffi.rst 3 additions, 2 deletionsdocs/users_guide/exts/ffi.rst
- testsuite/tests/ffi/should_fail/T21305_fail.hs 7 additions, 0 deletionstestsuite/tests/ffi/should_fail/T21305_fail.hs
- testsuite/tests/ffi/should_fail/T21305_fail.stderr 7 additions, 0 deletionstestsuite/tests/ffi/should_fail/T21305_fail.stderr
- testsuite/tests/ffi/should_fail/all.T 1 addition, 0 deletionstestsuite/tests/ffi/should_fail/all.T
- testsuite/tests/ffi/should_run/T21305.hs 48 additions, 0 deletionstestsuite/tests/ffi/should_run/T21305.hs
- testsuite/tests/ffi/should_run/T21305.stdout 1 addition, 0 deletionstestsuite/tests/ffi/should_run/T21305.stdout
- testsuite/tests/ffi/should_run/T21305_cmm.cmm 6 additions, 0 deletionstestsuite/tests/ffi/should_run/T21305_cmm.cmm
- testsuite/tests/ffi/should_run/all.T 3 additions, 0 deletionstestsuite/tests/ffi/should_run/all.T
Loading
Please register or sign in to comment