@@ -33777,6 +33777,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
33777
33777
}
33778
33778
return false;
33779
33779
}
33780
+ function isForceLazyParameterByType(type: Type): type is TypeReference {
33781
+ if (type.symbol && type.symbol.declarations && type.symbol.declarations.length > 0) {
33782
+ const tag = collectTsPlusTypeTags(type.symbol.declarations[0])[0];
33783
+ if (tag === "tsplus/ForceLazyArgument") {
33784
+ return true;
33785
+ }
33786
+ }
33787
+ return false;
33788
+ }
33780
33789
// TSPLUS EXTENSION END
33781
33790
33782
33791
function getMutableArrayOrTupleType(type: Type) {
@@ -34013,7 +34022,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
34013
34022
// TSPLUS EXTENTION START
34014
34023
const originalParamType = thisType;
34015
34024
let paramType = originalParamType;
34016
- if (isLazyParameterByType(originalParamType) && thisArgumentNode) {
34025
+ if (( isLazyParameterByType(originalParamType) || isForceLazyParameterByType(originalParamType) ) && thisArgumentNode) {
34017
34026
const contextFreeArgType = thisArgumentType;
34018
34027
if (isTypeIdenticalTo(contextFreeArgType, anyType) || isTypeIdenticalTo(contextFreeArgType, neverType)) {
34019
34028
return [createDiagnosticForNode(
@@ -34047,7 +34056,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
34047
34056
const originalParamType = getTypeAtPosition(signature, i);
34048
34057
const argType = checkExpressionWithContextualType(arg, unionIfLazy(originalParamType), /*inferenceContext*/ undefined, checkMode);
34049
34058
let paramType = originalParamType;
34050
- if (isLazyParameterByType(originalParamType)) {
34059
+ if (isLazyParameterByType(originalParamType) || isForceLazyParameterByType(originalParamType) ) {
34051
34060
if ((isTypeIdenticalTo(argType, anyType) || isTypeIdenticalTo(argType, neverType)) && !(checkMode & CheckMode.SkipGenericFunctions)) {
34052
34061
return [createDiagnosticForNode(
34053
34062
arg,
0 commit comments