Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
0bfd29c3
by Cheng Shao at 2026-03-09T04:54:46-04:00
3 changed files:
- compiler/GHC/Tc/Gen/Foreign.hs
- + testsuite/tests/ghci-wasm/T26998.hs
- testsuite/tests/ghci-wasm/all.T
Changes:
| ... | ... | @@ -449,8 +449,9 @@ tcFExport d = pprPanic "tcFExport" (ppr d) |
| 449 | 449 | |
| 450 | 450 | tcCheckFEType :: Type -> ForeignExport GhcRn -> TcM (ForeignExport GhcTc)
|
| 451 | 451 | tcCheckFEType sig_ty edecl@(CExport src (L l (CExportStatic str cconv))) = do
|
| 452 | - checkCg (Left edecl) backendValidityOfCExport
|
|
| 453 | - when (cconv /= JavaScriptCallConv) $ checkTc (isCLabelString str) (TcRnInvalidCIdentifier str)
|
|
| 452 | + when (cconv /= JavaScriptCallConv) $ do
|
|
| 453 | + checkCg (Left edecl) backendValidityOfCExport
|
|
| 454 | + checkTc (isCLabelString str) (TcRnInvalidCIdentifier str)
|
|
| 454 | 455 | cconv' <- checkCConv (Left edecl) cconv
|
| 455 | 456 | checkForeignArgs isFFIExternalTy arg_tys
|
| 456 | 457 | checkForeignRes nonIOok noCheckSafe isFFIExportResultTy res_ty
|
| 1 | +main :: IO ()
|
|
| 2 | +main = pure ()
|
|
| 3 | + |
|
| 4 | +foreign export javascript "my_main" main :: IO () |
| ... | ... | @@ -10,3 +10,5 @@ test('T26430', [ |
| 10 | 10 | extra_hc_opts('-L. -lT26430B')]
|
| 11 | 11 | , compile_and_run, ['']
|
| 12 | 12 | )
|
| 13 | + |
|
| 14 | +test('T26998', [], compile_and_run, ['']) |