@@ -27076,9 +27076,6 @@ function printFunction(fn) {
2707627076 if (fn.id !== null) {
2707727077 definition += fn.id;
2707827078 }
27079- else {
27080- definition += '<<anonymous>>';
27081- }
2708227079 if (fn.params.length !== 0) {
2708327080 definition +=
2708427081 '(' +
@@ -27097,8 +27094,10 @@ function printFunction(fn) {
2709727094 else {
2709827095 definition += '()';
2709927096 }
27100- definition += `: ${printPlace(fn.returns)}`;
27101- output.push(definition);
27097+ if (definition.length !== 0) {
27098+ output.push(definition);
27099+ }
27100+ output.push(`: ${printType(fn.returnType)} @ ${printPlace(fn.returns)}`);
2710227101 output.push(...fn.directives);
2710327102 output.push(printHIR(fn.body));
2710427103 return output.join('\n');
@@ -30923,6 +30922,7 @@ function lower$1(func, env, bindings = null, capturedRefs = new Map()) {
3092330922 params,
3092430923 fnType: bindings == null ? env.fnType : 'Other',
3092530924 returnTypeAnnotation: null,
30925+ returnType: makeType(),
3092630926 returns: createTemporaryPlace(env, (_b = func.node.loc) !== null && _b !== void 0 ? _b : GeneratedSource),
3092730927 body: builder.build(),
3092830928 context,
@@ -44546,7 +44546,7 @@ function codegenTerminal(cx, terminal) {
4454644546 ? codegenPlaceToExpression(cx, case_.test)
4454744547 : null;
4454844548 const block = codegenBlock(cx, case_.block);
44549- return libExports$1.switchCase(test, block.body.length === 0 ? [] : [block]);
44549+ return libExports$1.switchCase(test, [block]);
4455044550 }));
4455144551 }
4455244552 case 'throw': {
@@ -51683,13 +51683,12 @@ function inferMutationAliasingRanges(fn, { isFunctionExpression }) {
5168351683 }
5168451684 }
5168551685 }
51686- const returns = fn.returns.identifier;
5168751686 functionEffects.push({
5168851687 kind: 'Create',
5168951688 into: fn.returns,
51690- value: isPrimitiveType(returns)
51689+ value: fn.returnType.kind === 'Primitive'
5169151690 ? ValueKind.Primitive
51692- : isJsxType(returns.type )
51691+ : isJsxType(fn.returnType )
5169351692 ? ValueKind.Frozen
5169451693 : ValueKind.Mutable,
5169551694 reason: ValueReason.KnownReturnSignature,
@@ -55273,8 +55272,7 @@ function apply(func, unifier) {
5527355272 }
5527455273 }
5527555274 }
55276- const returns = func.returns.identifier;
55277- returns.type = unifier.get(returns.type);
55275+ func.returnType = unifier.get(func.returnType);
5527855276}
5527955277function equation(left, right) {
5528055278 return {
@@ -55316,13 +55314,13 @@ function* generate(func) {
5531655314 }
5531755315 }
5531855316 if (returnTypes.length > 1) {
55319- yield equation(func.returns.identifier.type , {
55317+ yield equation(func.returnType , {
5532055318 kind: 'Phi',
5532155319 operands: returnTypes,
5532255320 });
5532355321 }
5532455322 else if (returnTypes.length === 1) {
55325- yield equation(func.returns.identifier.type , returnTypes[0]);
55323+ yield equation(func.returnType , returnTypes[0]);
5532655324 }
5532755325}
5532855326function setName(names, id, name) {
@@ -55533,7 +55531,7 @@ function* generateInstructionTypes(env, names, instr) {
5553355531 yield equation(left, {
5553455532 kind: 'Function',
5553555533 shapeId: BuiltInFunctionId,
55536- return: value.loweredFunc.func.returns.identifier.type ,
55534+ return: value.loweredFunc.func.returnType ,
5553755535 isConstructor: false,
5553855536 });
5553955537 break;
@@ -57676,6 +57674,7 @@ function emitSelectorFn(env, keys) {
5767657674 env,
5767757675 params: [obj],
5767857676 returnTypeAnnotation: null,
57677+ returnType: makeType(),
5767957678 returns: createTemporaryPlace(env, GeneratedSource),
5768057679 context: [],
5768157680 effects: null,
@@ -58093,6 +58092,7 @@ function emitOutlinedFn(env, jsx, oldProps, globals) {
5809358092 env,
5809458093 params: [propsObj],
5809558094 returnTypeAnnotation: null,
58095+ returnType: makeType(),
5809658096 returns: createTemporaryPlace(env, GeneratedSource),
5809758097 context: [],
5809858098 effects: null,
0 commit comments