From 82b25020f6fc82fb368ab311b1f0e93fdf16fcb3 Mon Sep 17 00:00:00 2001 From: ncave <777696+ncave@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:18:36 -0700 Subject: [PATCH] Fix some build warnings --- package-lock.json | 14 +++++++------- src/Fable.Transforms/FSharp2Fable.fs | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41e865d384..75136effb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -505,11 +505,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -881,9 +881,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, diff --git a/src/Fable.Transforms/FSharp2Fable.fs b/src/Fable.Transforms/FSharp2Fable.fs index 22a134c048..376022e2d8 100644 --- a/src/Fable.Transforms/FSharp2Fable.fs +++ b/src/Fable.Transforms/FSharp2Fable.fs @@ -15,10 +15,10 @@ open Identifiers open Helpers open Util -let inline private transformExprList com ctx xs = +let private transformExprList com ctx xs = trampolineListMap (transformExpr com ctx []) xs -let inline private transformExprOpt com ctx opt = +let private transformExprOpt com ctx opt = trampolineOptionMap (transformExpr com ctx []) opt let private transformBaseConsCall @@ -74,7 +74,7 @@ let private transformNewUnion com ctx r fsType (unionCase: FSharpUnionCase) (arg | TypeScriptTaggedUnion(_, _, tagName, rule) -> match argExprs with - | [ argExpr ] when not (FsUnionCase.HasNamedFields unionCase) -> argExpr + // | [ argExpr ] when not (FsUnionCase.HasNamedFields unionCase) -> argExpr | _ -> let isCompiledValue, tagExpr = match FsUnionCase.CompiledValue unionCase with @@ -1176,16 +1176,16 @@ let private transformExpr (com: IFableCompiler) (ctx: Context) appliedGenArgs fs return Fable.Get(unionExpr, Fable.TupleIndex index, fieldType, r) | TypeScriptTaggedUnion _ -> - if FsUnionCase.HasNamedFields unionCase then - let kind = - Fable.FieldInfo.Create( - FsField.FSharpFieldName field, - fieldType = makeType Map.empty field.FieldType - ) + // if not (FsUnionCase.HasNamedFields unionCase) then + // return unionExpr + // else + let kind = + Fable.FieldInfo.Create( + FsField.FSharpFieldName field, + fieldType = makeType Map.empty field.FieldType + ) - return Fable.Get(unionExpr, kind, fieldType, r) - else - return unionExpr + return Fable.Get(unionExpr, kind, fieldType, r) | StringEnum _ -> return "StringEnum types cannot have fields"