diff --git a/packages/uni-uts-v1/src/kotlin.ts b/packages/uni-uts-v1/src/kotlin.ts index 7c5b0c9e398..3bec2b0441f 100644 --- a/packages/uni-uts-v1/src/kotlin.ts +++ b/packages/uni-uts-v1/src/kotlin.ts @@ -26,7 +26,6 @@ import { isColorSupported, isEnableGenericsParameterDefaults, isEnableInlineReified, - isEnableNarrowType, isEnableUTSNumber, moveRootIndexSourceMap, normalizeUTSResult, @@ -639,7 +638,7 @@ export async function compile( uniExtApiNamespaces: extApis, uniExtApiDefaultParameters: parseExtApiDefaultParameters(), enableUtsNumber: isEnableUTSNumber(), - enableNarrowType: isEnableNarrowType(), + enableNarrowType: false, // 这里的启用是把部分typeof转换成instanceof,这样确实好一点,但会引发一些kotlin之类的警告,暂不开启 enableGenericsParameterDefaults: isEnableGenericsParameterDefaults(), enableInlineReified: isEnableInlineReified(), ...transform, diff --git a/packages/uni-uts-v1/src/tsc/compiler.ts b/packages/uni-uts-v1/src/tsc/compiler.ts index 108bbff3439..97d5fc24195 100644 --- a/packages/uni-uts-v1/src/tsc/compiler.ts +++ b/packages/uni-uts-v1/src/tsc/compiler.ts @@ -85,8 +85,8 @@ export function createUniXCompiler( watchFile, incremental: mode === 'development', transformOptions: { - enableUTSNumber: isEnableUTSNumber(), - enableNarrowType: isEnableNarrowType(), + enableUTSNumber: false, + enableNarrowType: true, // 默认开启 enableGenericsParameterDefaults: isEnableGenericsParameterDefaults(), }, ...options, diff --git a/packages/uni-uts-v1/src/uvue/index.ts b/packages/uni-uts-v1/src/uvue/index.ts index 8d293925f9b..f8e0ba38b3b 100644 --- a/packages/uni-uts-v1/src/uvue/index.ts +++ b/packages/uni-uts-v1/src/uvue/index.ts @@ -171,8 +171,8 @@ export async function compileApp(entry: string, options: CompileAppOptions) { uniCloudObjectInfo: options.uniCloudObjectInfo, autoImports, uniModulesArtifacts: options.uniModulesArtifacts, - enableUtsNumber: isEnableUTSNumber(), - enableNarrowType: isEnableNarrowType(), + enableUtsNumber: false, + enableNarrowType: false, // 这里的启用是把部分typeof转换成instanceof,这样确实好一点,但会引发一些kotlin之类的警告,暂不开启 enableInlineReified: isEnableInlineReified(), ...options.transform, },