From bc384baa06c8b604823c235b984beec42e03ffb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Szab=C3=B3?= Date: Sat, 2 Aug 2025 15:43:49 +0200 Subject: [PATCH] Remove internal type from __Sealed attribute in implicit_context.hhi D74667088 marked MemoSensitiveImplicitContext as __Sealed, with only a single class permitted to directly extend it. This class is however internal to Meta, causing typechecking errors in OSS Hack. As a fix, mark the attribute with `// @oss-disable` to remove it during the code export process. NOTE: If I'm understanding the docs[1] for `@oss-disable` / `@oss-enable` correctly, this should be the correct way to make this change, which should then transform into `// @oss-disable FBMemoAgnosticImplicitContext::class` once this patch is merged and exported. Let me know if this assumption is incorrect. [1] https://github.com/facebook/buck2/blob/239ab927a5be7dee3035141d29e2e9c91e8ea771/HACKING.md?plain=1#L168 --- hphp/hack/hhi/implicit_context.hhi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hphp/hack/hhi/implicit_context.hhi b/hphp/hack/hhi/implicit_context.hhi index 4946fa70cc4ec..7ea55a3c868d1 100644 --- a/hphp/hack/hhi/implicit_context.hhi +++ b/hphp/hack/hhi/implicit_context.hhi @@ -35,7 +35,8 @@ namespace HH { } // namespace ImplicitContext - <<__Sealed(FBMemoAgnosticImplicitContext::class)>> + // Avoid referencing an internal class in OSS. + <<__Sealed(FBMemoAgnosticImplicitContext::class)>> // @oss-disable abstract class MemoAgnosticImplicitContext extends ImplicitContextBase { final protected static async function runWithAsync( this::TData $context, @@ -48,7 +49,8 @@ namespace HH { )[this::CRun, ctx $f]: Tout; } - <<__Sealed(FBMemoSensitiveImplicitContext::class)>> + // Avoid referencing an internal class in OSS. + <<__Sealed(FBMemoSensitiveImplicitContext::class)>> // @oss-disable abstract class MemoSensitiveImplicitContext extends ImplicitContextBase { abstract const type TData as IPureMemoizeParam;