@@ -27076,9 +27076,6 @@ function printFunction(fn) {
27076
27076
if (fn.id !== null) {
27077
27077
definition += fn.id;
27078
27078
}
27079
- else {
27080
- definition += '<<anonymous>>';
27081
- }
27082
27079
if (fn.params.length !== 0) {
27083
27080
definition +=
27084
27081
'(' +
@@ -27097,8 +27094,10 @@ function printFunction(fn) {
27097
27094
else {
27098
27095
definition += '()';
27099
27096
}
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)}`);
27102
27101
output.push(...fn.directives);
27103
27102
output.push(printHIR(fn.body));
27104
27103
return output.join('\n');
@@ -30923,6 +30922,7 @@ function lower$1(func, env, bindings = null, capturedRefs = new Map()) {
30923
30922
params,
30924
30923
fnType: bindings == null ? env.fnType : 'Other',
30925
30924
returnTypeAnnotation: null,
30925
+ returnType: makeType(),
30926
30926
returns: createTemporaryPlace(env, (_b = func.node.loc) !== null && _b !== void 0 ? _b : GeneratedSource),
30927
30927
body: builder.build(),
30928
30928
context,
@@ -44546,7 +44546,7 @@ function codegenTerminal(cx, terminal) {
44546
44546
? codegenPlaceToExpression(cx, case_.test)
44547
44547
: null;
44548
44548
const block = codegenBlock(cx, case_.block);
44549
- return libExports$1.switchCase(test, block.body.length === 0 ? [] : [block]);
44549
+ return libExports$1.switchCase(test, [block]);
44550
44550
}));
44551
44551
}
44552
44552
case 'throw': {
@@ -51683,13 +51683,12 @@ function inferMutationAliasingRanges(fn, { isFunctionExpression }) {
51683
51683
}
51684
51684
}
51685
51685
}
51686
- const returns = fn.returns.identifier;
51687
51686
functionEffects.push({
51688
51687
kind: 'Create',
51689
51688
into: fn.returns,
51690
- value: isPrimitiveType(returns)
51689
+ value: fn.returnType.kind === 'Primitive'
51691
51690
? ValueKind.Primitive
51692
- : isJsxType(returns.type )
51691
+ : isJsxType(fn.returnType )
51693
51692
? ValueKind.Frozen
51694
51693
: ValueKind.Mutable,
51695
51694
reason: ValueReason.KnownReturnSignature,
@@ -55273,8 +55272,7 @@ function apply(func, unifier) {
55273
55272
}
55274
55273
}
55275
55274
}
55276
- const returns = func.returns.identifier;
55277
- returns.type = unifier.get(returns.type);
55275
+ func.returnType = unifier.get(func.returnType);
55278
55276
}
55279
55277
function equation(left, right) {
55280
55278
return {
@@ -55316,13 +55314,13 @@ function* generate(func) {
55316
55314
}
55317
55315
}
55318
55316
if (returnTypes.length > 1) {
55319
- yield equation(func.returns.identifier.type , {
55317
+ yield equation(func.returnType , {
55320
55318
kind: 'Phi',
55321
55319
operands: returnTypes,
55322
55320
});
55323
55321
}
55324
55322
else if (returnTypes.length === 1) {
55325
- yield equation(func.returns.identifier.type , returnTypes[0]);
55323
+ yield equation(func.returnType , returnTypes[0]);
55326
55324
}
55327
55325
}
55328
55326
function setName(names, id, name) {
@@ -55533,7 +55531,7 @@ function* generateInstructionTypes(env, names, instr) {
55533
55531
yield equation(left, {
55534
55532
kind: 'Function',
55535
55533
shapeId: BuiltInFunctionId,
55536
- return: value.loweredFunc.func.returns.identifier.type ,
55534
+ return: value.loweredFunc.func.returnType ,
55537
55535
isConstructor: false,
55538
55536
});
55539
55537
break;
@@ -57676,6 +57674,7 @@ function emitSelectorFn(env, keys) {
57676
57674
env,
57677
57675
params: [obj],
57678
57676
returnTypeAnnotation: null,
57677
+ returnType: makeType(),
57679
57678
returns: createTemporaryPlace(env, GeneratedSource),
57680
57679
context: [],
57681
57680
effects: null,
@@ -58093,6 +58092,7 @@ function emitOutlinedFn(env, jsx, oldProps, globals) {
58093
58092
env,
58094
58093
params: [propsObj],
58095
58094
returnTypeAnnotation: null,
58095
+ returnType: makeType(),
58096
58096
returns: createTemporaryPlace(env, GeneratedSource),
58097
58097
context: [],
58098
58098
effects: null,
0 commit comments