@magnusopera/fscript 0.92.2 → 0.92.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,7 @@ import { array_type, class_type, tuple_type, list_type, bool_type, float64_type,
|
|
|
14
14
|
import { exists as exists_2, forAll as forAll_1, tryPick, tryFind as tryFind_2, foldBack, iterate as iterate_1, filter as filter_1, map as map_2, toList as toList_1 } from "../fable_modules/fable-library-js.5.27.0/Seq.js";
|
|
15
15
|
import { last as last_2, setItem, item as item_22 } from "../fable_modules/fable-library-js.5.27.0/Array.js";
|
|
16
16
|
import { distinct } from "../fable_modules/fable-library-js.5.27.0/Seq2.js";
|
|
17
|
+
import { check } from "./MatchCoverage.js";
|
|
17
18
|
import { builtinReservedNames, builtinSchemes } from "./BuiltinSignatures.js";
|
|
18
19
|
import { ofExterns, typeDefinitions } from "./HostInterop.js";
|
|
19
20
|
import { typeDefs as typeDefs_2 } from "./BuiltinTypes.js";
|
|
@@ -2863,10 +2864,12 @@ function inferExprRaw(telemetry, typeDefs, constructors, env, expr) {
|
|
|
2863
2864
|
return [compose(patternInput_19[0], sRec), tBody_4, asTyped(telemetry, expr, tBody_4)];
|
|
2864
2865
|
}
|
|
2865
2866
|
case 9: {
|
|
2867
|
+
const cases = expr.fields[1];
|
|
2866
2868
|
const patternInput_20 = inferExpr(telemetry, typeDefs, constructors, env, expr.fields[0]);
|
|
2869
|
+
const tScrut = patternInput_20[1];
|
|
2867
2870
|
let sAcc_1 = patternInput_20[0];
|
|
2868
2871
|
let resultTypeOpt = undefined;
|
|
2869
|
-
const enumerator_3 = getEnumerator(
|
|
2872
|
+
const enumerator_3 = getEnumerator(cases);
|
|
2870
2873
|
try {
|
|
2871
2874
|
while (enumerator_3["System.Collections.IEnumerator.MoveNext"]()) {
|
|
2872
2875
|
let tPrev, sEq;
|
|
@@ -2875,7 +2878,7 @@ function inferExprRaw(telemetry, typeDefs, constructors, env, expr) {
|
|
|
2875
2878
|
const caseSpan = forLoopVar_2[3];
|
|
2876
2879
|
const patternInput_21 = inferPattern(telemetry, typeDefs, constructors, forLoopVar_2[0]);
|
|
2877
2880
|
const envPat_1 = patternInput_21[0];
|
|
2878
|
-
const sPat = unify(typeDefs, applyType(sAcc_1,
|
|
2881
|
+
const sPat = unify(typeDefs, applyType(sAcc_1, tScrut), patternInput_21[1], caseSpan);
|
|
2879
2882
|
const envCase$0027 = fold_1((acc_3, k, v) => add(k, new Scheme(empty_2(), applyType(sPat, v)), acc_3), applyEnv(compose(sPat, sAcc_1), env), envPat_1);
|
|
2880
2883
|
const patternInput_23 = withLocalBindings(telemetry, map_1((tuple_2) => tuple_2[0], toList(envPat_1)), () => {
|
|
2881
2884
|
let envBodyCase = envCase$0027;
|
|
@@ -2900,6 +2903,7 @@ function inferExprRaw(telemetry, typeDefs, constructors, env, expr) {
|
|
|
2900
2903
|
finally {
|
|
2901
2904
|
disposeSafe(enumerator_3);
|
|
2902
2905
|
}
|
|
2906
|
+
check(typeDefs, applyType(sAcc_1, tScrut), cases, expr.fields[2]);
|
|
2903
2907
|
const tRes_3 = defaultArg(resultTypeOpt, Types_freshVar());
|
|
2904
2908
|
return [sAcc_1, tRes_3, asTyped(telemetry, expr, tRes_3)];
|
|
2905
2909
|
}
|
|
@@ -5835,14 +5839,18 @@ export function inferProgramWithRegistration(registration, program) {
|
|
|
5835
5839
|
return inferProgramWithExternsRawAndLocals(false, registration, program)[0];
|
|
5836
5840
|
}
|
|
5837
5841
|
|
|
5838
|
-
export function
|
|
5842
|
+
export function inferProgramWithRegistrationAndTypes(registration, program) {
|
|
5839
5843
|
if (exists((ext) => contains(ext.Name, builtinReservedNames), registration.Functions)) {
|
|
5840
5844
|
throw new TypeException(new TypeError$("Host extern collides with reserved stdlib symbol", unknownSpan));
|
|
5841
5845
|
}
|
|
5842
5846
|
if (exists((name) => contains(name, builtinReservedNames), topLevelBindingNames(program))) {
|
|
5843
5847
|
throw new TypeException(new TypeError$("Top-level binding collides with reserved stdlib symbol", unknownSpan));
|
|
5844
5848
|
}
|
|
5845
|
-
|
|
5849
|
+
return inferProgramWithExternsRawAndLocals(true, registration, program);
|
|
5850
|
+
}
|
|
5851
|
+
|
|
5852
|
+
export function inferProgramWithRegistrationAndLocalVariableTypes(registration, program) {
|
|
5853
|
+
const patternInput = inferProgramWithRegistrationAndTypes(registration, program);
|
|
5846
5854
|
return [patternInput[0], patternInput[1]];
|
|
5847
5855
|
}
|
|
5848
5856
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"Version":"5.27.0","FableOptions":{"TypedArrays":true,"ClampByteArrays":false,"Language":["JavaScript"],"Define":["FABLE_COMPILER","FABLE_COMPILER_5","FABLE_COMPILER_JAVASCRIPT"],"DebugMode":false,"OptimizeFSharpAst":false,"Verbosity":["Normal"],"FileExtension":".js","TriggeredByDependency":false,"NoReflection":false,"JsTemporal":false},"ProjectPath":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/FScript.JavaScript.fsproj","SourcePaths":["/home/runner/work/FScript/FScript/src/FScript.Language/Span.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Error.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Token.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Ast.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Types.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Value.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Lexer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Parser.fs","/home/runner/work/FScript/FScript/src/FScript.Language/IncludeResolver.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinTypes.fs","/home/runner/work/FScript/FScript/src/FScript.Language/HostInterop.fs","/home/runner/work/FScript/FScript/src/FScript.Language/SupportLibrary.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Execution.fs","/home/runner/work/FScript/FScript/src/FScript.Language/SupportCollections.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TypeInfer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskSharingAnalysis.fs","/home/runner/work/FScript/FScript/src/FScript.Language/ExportSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/DebugHooks.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Eval.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Interactive.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Pretty.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Library.fs","/home/runner/work/FScript/FScript/src/FScript.JavaScript/Library.fs"],"FSharpOptions":["--define:FABLE_COMPILER","--define:FABLE_COMPILER_5","--define:FABLE_COMPILER_JAVASCRIPT","--define:TRACE","--define:RELEASE","--define:NETSTANDARD","--define:NETSTANDARD2_1","--define:NETSTANDARD1_0_OR_GREATER","--define:NETSTANDARD1_1_OR_GREATER","--define:NETSTANDARD1_2_OR_GREATER","--define:NETSTANDARD1_3_OR_GREATER","--define:NETSTANDARD1_4_OR_GREATER","--define:NETSTANDARD1_5_OR_GREATER","--define:NETSTANDARD1_6_OR_GREATER","--define:NETSTANDARD2_0_OR_GREATER","--define:NETSTANDARD2_1_OR_GREATER","--define:NULLABLE","--langversion:preview","--nowarn:FS0988","--targetprofile:netstandard","--noframework","--nologo","--simpleresolution","--nocopyfsharpcore","--nowin32manifest","--warn:3","--fullpaths","--flaterrors","--optimize-","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ValueTuple.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Thread.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Tasks.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.RegularExpressions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.InteropServices.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Net.Requests.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.IO.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Globalization.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tracing.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tools.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Debug.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Core.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Console.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.TypeConverter.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.Concurrent.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/netstandard.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/mscorlib.dll","-r:/home/runner/.nuget/packages/fsharp.core/10.1.404/lib/netstandard2.1/FSharp.Core.dll","-r:/home/runner/.nuget/packages/fable.core/5.6.1/lib/netstandard2.0/Fable.Core.dll"],"References":["/home/runner/work/FScript/FScript/src/FScript.Language/FScript.Language.fsproj"],"OutDir":["Some","/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist"],"FableLib":null,"FableLibDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules/fable-library-js.5.27.0","FableModulesDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules","OutputType":["Library"],"TargetFramework":["Some","netstandard2.1"],"Configuration":"Release","Exclude":[],"Replace":{},"SourceMaps":false,"SourceMapsRoot":null,"TreatWarningsAsErrors":true}
|
|
1
|
+
{"Version":"5.27.0","FableOptions":{"TypedArrays":true,"ClampByteArrays":false,"Language":["JavaScript"],"Define":["FABLE_COMPILER","FABLE_COMPILER_5","FABLE_COMPILER_JAVASCRIPT"],"DebugMode":false,"OptimizeFSharpAst":false,"Verbosity":["Normal"],"FileExtension":".js","TriggeredByDependency":false,"NoReflection":false,"JsTemporal":false},"ProjectPath":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/FScript.JavaScript.fsproj","SourcePaths":["/home/runner/work/FScript/FScript/src/FScript.Language/Span.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Error.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Token.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Ast.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Types.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Value.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Lexer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Parser.fs","/home/runner/work/FScript/FScript/src/FScript.Language/IncludeResolver.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinTypes.fs","/home/runner/work/FScript/FScript/src/FScript.Language/HostInterop.fs","/home/runner/work/FScript/FScript/src/FScript.Language/SupportLibrary.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Execution.fs","/home/runner/work/FScript/FScript/src/FScript.Language/SupportCollections.fs","/home/runner/work/FScript/FScript/src/FScript.Language/BuiltinFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskFunctions.fs","/home/runner/work/FScript/FScript/src/FScript.Language/MatchCoverage.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TypeInfer.fs","/home/runner/work/FScript/FScript/src/FScript.Language/TaskSharingAnalysis.fs","/home/runner/work/FScript/FScript/src/FScript.Language/ExportSignatures.fs","/home/runner/work/FScript/FScript/src/FScript.Language/DebugHooks.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Eval.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Interactive.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Pretty.fs","/home/runner/work/FScript/FScript/src/FScript.Language/Library.fs","/home/runner/work/FScript/FScript/src/FScript.JavaScript/Library.fs"],"FSharpOptions":["--define:FABLE_COMPILER","--define:FABLE_COMPILER_5","--define:FABLE_COMPILER_JAVASCRIPT","--define:TRACE","--define:RELEASE","--define:NETSTANDARD","--define:NETSTANDARD2_1","--define:NETSTANDARD1_0_OR_GREATER","--define:NETSTANDARD1_1_OR_GREATER","--define:NETSTANDARD1_2_OR_GREATER","--define:NETSTANDARD1_3_OR_GREATER","--define:NETSTANDARD1_4_OR_GREATER","--define:NETSTANDARD1_5_OR_GREATER","--define:NETSTANDARD1_6_OR_GREATER","--define:NETSTANDARD2_0_OR_GREATER","--define:NETSTANDARD2_1_OR_GREATER","--define:NULLABLE","--langversion:preview","--nowarn:FS0988","--targetprofile:netstandard","--noframework","--nologo","--simpleresolution","--nocopyfsharpcore","--nowin32manifest","--warn:3","--fullpaths","--flaterrors","--optimize-","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ValueTuple.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Thread.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.Tasks.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Threading.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.RegularExpressions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Text.Encoding.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.InteropServices.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Runtime.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.Extensions.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Reflection.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Numerics.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Net.Requests.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.IO.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Globalization.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tracing.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Tools.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Diagnostics.Debug.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Core.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Console.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.TypeConverter.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.Primitives.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.ComponentModel.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/System.Collections.Concurrent.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/netstandard.dll","-r:/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0/ref/netstandard2.1/mscorlib.dll","-r:/home/runner/.nuget/packages/fsharp.core/10.1.404/lib/netstandard2.1/FSharp.Core.dll","-r:/home/runner/.nuget/packages/fable.core/5.6.1/lib/netstandard2.0/Fable.Core.dll"],"References":["/home/runner/work/FScript/FScript/src/FScript.Language/FScript.Language.fsproj"],"OutDir":["Some","/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist"],"FableLib":null,"FableLibDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules/fable-library-js.5.27.0","FableModulesDir":"/home/runner/work/FScript/FScript/src/FScript.JavaScript/dist/fable_modules","OutputType":["Library"],"TargetFramework":["Some","netstandard2.1"],"Configuration":"Release","Exclude":[],"Replace":{},"SourceMaps":false,"SourceMapsRoot":null,"TreatWarningsAsErrors":true}
|