@@ -33345,6 +33345,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
33345
33345
}
33346
33346
return false;
33347
33347
}
33348
+ function isForceLazyParameterByType(type: Type): type is TypeReference {
33349
+ if (type.symbol && type.symbol.declarations && type.symbol.declarations.length > 0) {
33350
+ const tag = collectTsPlusTypeTags(type.symbol.declarations[0])[0];
33351
+ if (tag === "tsplus/ForceLazyArgument") {
33352
+ return true;
33353
+ }
33354
+ }
33355
+ return false;
33356
+ }
33348
33357
// TSPLUS EXTENSION END
33349
33358
33350
33359
function getMutableArrayOrTupleType(type: Type) {
@@ -33572,7 +33581,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
33572
33581
// TSPLUS EXTENTION START
33573
33582
const originalParamType = thisType;
33574
33583
let paramType = originalParamType;
33575
- if (isLazyParameterByType(originalParamType) && thisArgumentNode) {
33584
+ if (( isLazyParameterByType(originalParamType) || isForceLazyParameterByType(originalParamType) ) && thisArgumentNode) {
33576
33585
const contextFreeArgType = thisArgumentType;
33577
33586
if (isTypeIdenticalTo(contextFreeArgType, anyType) || isTypeIdenticalTo(contextFreeArgType, neverType)) {
33578
33587
return [createDiagnosticForNode(
@@ -33606,7 +33615,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
33606
33615
const originalParamType = getTypeAtPosition(signature, i);
33607
33616
const argType = checkExpressionWithContextualType(arg, unionIfLazy(originalParamType), /*inferenceContext*/ undefined, checkMode);
33608
33617
let paramType = originalParamType;
33609
- if (isLazyParameterByType(originalParamType)) {
33618
+ if (isLazyParameterByType(originalParamType) || isForceLazyParameterByType(originalParamType) ) {
33610
33619
if ((isTypeIdenticalTo(argType, anyType) || isTypeIdenticalTo(argType, neverType)) && !(checkMode & CheckMode.SkipGenericFunctions)) {
33611
33620
return [createDiagnosticForNode(
33612
33621
arg,
0 commit comments