You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[compiler] More readable alias signature declarations (#33530)
Now that we have support for defining aliasing signatures in
moduleTypeProvider, which uses string names for
receiver/args/returns/etc, we can reuse that same form for builtin
declarations. The declarations are written in the unparsed form and than
parsed/validated when registered (in the addFunction/addHook call).
This also required flushing out configs/schemas for more effect types.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33530).
* #33571
* #33558
* #33547
* #33543
* #33533
* #33532
* __->__ #33530
@@ -987,90 +966,6 @@ export function installTypeConfig(
987
966
}
988
967
}
989
968
990
-
functionparseAliasingSignatureConfig(
991
-
typeConfig: AliasingSignatureConfig,
992
-
moduleName: string,
993
-
loc: SourceLocation,
994
-
): AliasingSignature{
995
-
constlifetimes=newMap<string,Place>();
996
-
functiondefine(temp: string): Place{
997
-
CompilerError.invariant(!lifetimes.has(temp),{
998
-
reason: `Invalid type configuration for module`,
999
-
description: `Expected aliasing signature to have unique names for receiver, params, rest, returns, and temporaries in module '${moduleName}'`,
1000
-
loc,
1001
-
});
1002
-
constplace=signatureArgument(lifetimes.size);
1003
-
lifetimes.set(temp,place);
1004
-
returnplace;
1005
-
}
1006
-
functionlookup(temp: string): Place{
1007
-
constplace=lifetimes.get(temp);
1008
-
CompilerError.invariant(place!=null,{
1009
-
reason: `Invalid type configuration for module`,
1010
-
description: `Expected aliasing signature effects to reference known names from receiver/params/rest/returns/temporaries, but '${temp}' is not a known name in '${moduleName}'`,
0 commit comments