@glutinum/cli 1.0.0-beta.6 → 1.0.0-beta.7

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.
@@ -1,9 +1,9 @@
1
1
 
2
2
  import { FSharpRef, Record } from "../fable_modules/fable-library-js.5.17.2/Types.js";
3
- import { Reporter__get_HasIterable, Reporter__get_HasReadonlyArray, Reporter__get_HasRegEpx, Reporter__get_Errors, Reporter__get_Warnings, TransformState_Create_Z68CEF8E2, TypeLiteralsMemory_$ctor, Reporter_$ctor, TransformContext__ToList, TransformContext_$ctor_Z1635F75A, TransformContext__get__Reporter, TransformContext__set_SiblingTypeNames_2FCB1351, TypeLiteralsMemory__LeaveModule, TypeLiteralsMemory__EnterModule_Z721C83C5, TransformContext__ExposeTypeAlias_1CE4A880, TransformContext__AddWarning_Z721C83C5, sanitizeTypeNameAndPushScope, ImportSource, importAllAttribute, TransformContext__get_TypeMemory, importAttribute, sanitizeMemberNameAndPushScope, TransformContext__get_ImportSource, importDefaultAttribute, TransformContext__AddError_Z721C83C5, TypeLiteralsMemory__Remember_74C8CBB, TransformContext__get_TypeLiteralsMemory, TransformContext__get_Root, TypeLiteralsMemory__TryReference_433E080, TransformContext__get_State, TransformContext__get_FullName, TransformContext__ExposeType_Z1D58A540, TransformContext__PushScope_27AED5E3, sanitizeNameAndPushScope, TransformContext__NewTypeName, TransformContext__get_CurrentScopeName, TransformContext__ExposeIterable, TransformContext__ReferenceName_Z721C83C5, TransformContext__get_OriginalScopeName, TransformContext__ExposeTypeAlias_Z721C83C5, TransformContext__ExposeReadonlyArray, ImportSource_$reflection, TransformContext_$reflection } from "./Transformer/Context.js";
3
+ import { Reporter__get_HasIterable, Reporter__get_HasReadonlyArray, Reporter__get_HasRegEpx, Reporter__get_Errors, Reporter__get_Warnings, TransformState_Create_Z68CEF8E2, TypeLiteralsMemory_$ctor, Reporter_$ctor, TransformContext__ToList, TransformContext_$ctor_Z1635F75A, TypeLiteralsMemory__EnterFileModule_Z721C83C5, TransformContext__get__Reporter, TransformContext__set_SiblingTypeNames_2FCB1351, TypeLiteralsMemory__LeaveModule, TypeLiteralsMemory__EnterModule_Z721C83C5, TransformContext__ExposeTypeAlias_1CE4A880, TransformContext__AddWarning_Z721C83C5, sanitizeTypeNameAndPushScope, ImportSource, importAllAttribute, TransformContext__get_TypeMemory, importAttribute, sanitizeMemberNameAndPushScope, TransformContext__get_ImportSource, importDefaultAttribute, TransformContext__AddError_Z721C83C5, TypeLiteralsMemory__Remember_74C8CBB, TransformContext__get_TypeLiteralsMemory, TransformContext__get_Root, TypeLiteralsMemory__TryReference_433E080, TransformContext__get_State, TransformContext__get_FullName, TransformContext__ExposeType_Z1D58A540, TransformContext__PushScope_27AED5E3, sanitizeNameAndPushScope, TransformContext__NewTypeName, TransformContext__get_CurrentScopeName, TransformContext__ExposeIterable, TransformContext__ReferenceName_Z721C83C5, TransformContext__get_OriginalScopeName, TransformContext__ExposeTypeAlias_Z721C83C5, TransformContext__ExposeReadonlyArray, ImportSource_$reflection, TransformContext_$reflection } from "./Transformer/Context.js";
4
4
  import { int32_type, array_type, option_type, list_type, record_type, class_type, string_type, bool_type } from "../fable_modules/fable-library-js.5.17.2/Reflection.js";
5
5
  import { FSharpModule, FSharpSingleErasedCaseUnion, FSharpJSApi, FSharpEnum, FSharpEnumCase, FSharpLiteral, FSharpTypeParameterInfo_Create_Z6CFD3565, FSharpUnionCaseNamed, FSharpClass, FSharpConstructor, FSharpExplicitField, FSharpStaticMemberInfo, FSharpAccessor, FSharpMemberInfoBody, FSharpAccessibility, FSharpMember, FSharpMemberInfo, FSharpParameter, FSharpThisType, FSharpPrimitive, FSharpTypeAlias, FSharpDelegate, FSharpFunctionType, FSharpTypeReference, FSharpUnion, FSharpUnionCase, FSharpTypeParameter, FSharpMapped, FSharpInterface, FSharpAttribute, FSharpType, FSharpType_$reflection, FSharpTypeParameter_$reflection, FSharpMember_$reflection } from "./FsharpAST.js";
6
- import { GlueReExport, GlueClassDeclaration, GlueLiteral__ToText, GlueIndexSignature, GlueLiteral, GlueMember__TryGetAccessor, GlueMember__get_Documentation, GlueProperty, GlueAccessor, GlueMethod, GlueMethodSignature, GlueSubstitution_mentionedTypeParameters, GlueFunctionType, GlueParameter, GlueTypeUnion, GlueFunctionDeclaration, GlueVariable, GlueType__get_Name, GlueConstructor, GlueTypeReference, GluePrimitive, GlueType, GlueTypeLiteral, GlueMember, GlueTypeParameter, GlueSubstitution_substitute, GlueSubstitution_substituteParameter, GlueInterface, GlueTypeAliasDeclaration_$reflection, GlueType_$reflection } from "./GlueAST.js";
6
+ import { GlueReExport, GlueTypeReference, GlueClassDeclaration, GlueLiteral__ToText, GlueIndexSignature, GlueLiteral, GlueMember__TryGetAccessor, GlueMember__get_Documentation, GluePrimitive, GlueProperty, GlueAccessor, GlueMethod, GlueMethodSignature, GlueSubstitution_mentionedTypeParameters, GlueFunctionType, GlueParameter, GlueTypeUnion, GlueFunctionDeclaration, GlueVariable, GlueType__get_Name, GlueConstructor, GlueType, GlueTypeLiteral, GlueMember, GlueTypeParameter, GlueSubstitution_substitute, GlueSubstitution_substituteParameter, GlueInterface, GlueTypeAliasDeclaration_$reflection, GlueType_$reflection } from "./GlueAST.js";
7
7
  import { transformComment, TransformCommentResult_$reflection } from "./Transformer/Comment.js";
8
8
  import { add, contains as contains_2, union, empty as empty_2, ofSeq, singleton as singleton_2, ofList, FSharpSet__Contains } from "../fable_modules/fable-library-js.5.17.2/Set.js";
9
9
  import { aggregatedExports, replaceSelfReference, isUnitAlias, typedArrayNames, transformPrimitive, requiredBeforeParamArray, isDataObject, Interface_makePartial, tryUnwrapOption, iteratorNames } from "./Transformer/Utils.js";
@@ -13,7 +13,7 @@ import { aliasArities, namedTypeParameters, membersNameUndeclaredTypeParameters,
13
13
  import { List_groupBy, List_distinct } from "../fable_modules/fable-library-js.5.17.2/Seq2.js";
14
14
  import { uncurry2, curry2, Lazy, structuralHash, Exception, numberHash, int32ToString, disposeSafe, getEnumerator, defaultOf, comparePrimitives, safeHash, equals, stringHash } from "../fable_modules/fable-library-js.5.17.2/Util.js";
15
15
  import { replace, trim, printf, toFail, substring, interpolate, concat } from "../fable_modules/fable-library-js.5.17.2/String.js";
16
- import { resolveMembers, resolveFunction, isConditionalAlias, genericDelegateTypeParameters, isInterfaceDeclaration } from "./Transformer/Conditionals.js";
16
+ import { resolveMembers, resolveFunction, isConditionalAlias, isInterfaceDeclaration } from "./Transformer/Conditionals.js";
17
17
  import { FSharpMap__TryFind, exists as exists_1, empty as empty_3, ofList as ofList_1, FSharpMap__ContainsKey, FSharpMap__get_Item, map as map_1 } from "../fable_modules/fable-library-js.5.17.2/Map.js";
18
18
  import { sanitizeTypeNameWithResult, removeSurroundingQuotes, sanitizeTypeName } from "./Utils/Naming.js";
19
19
  import { addToSet, tryGetValue } from "../fable_modules/fable-library-js.5.17.2/MapUtil.js";
@@ -26,7 +26,7 @@ import { capitalizeFirstLetter } from "./Utils/String.js";
26
26
  import { expandMembers } from "./Transformer/AnyFunctionOverloads.js";
27
27
  import { min } from "../fable_modules/fable-library-js.5.17.2/Double.js";
28
28
  import { inheritsIterable, asMethods, tryCallableHeritage } from "./Transformer/CallableProperties.js";
29
- import { withoutBaseClassProperties, isInheritableType, isSelfHeritage, isArrayHeritage, isErrorHeritage, withoutRedeclaredBases } from "./Transformer/Heritage.js";
29
+ import { withoutBaseClassProperties, withoutBasesOfBases, isInheritableType, isSelfHeritage, isArrayHeritage, isErrorHeritage, withoutRedeclaredBases } from "./Transformer/Heritage.js";
30
30
  import { contains as contains_1 } from "../fable_modules/fable-library-js.5.17.2/Array.js";
31
31
  import { isCandidate, tryResolveMembers } from "./Transformer/ParamObjectCandidate.js";
32
32
  import { op_UnaryNegation_Int32 } from "../fable_modules/fable-library-js.5.17.2/Int32.js";
@@ -1061,8 +1061,7 @@ function transformType(context_mut, glueType_mut) {
1061
1061
  transformType:
1062
1062
  while (true) {
1063
1063
  const context = context_mut, glueType = glueType_mut;
1064
- let typeReference_1;
1065
- let matchResult, constructSignature, primitiveInfo, glueType_21, thisTypeInfo, glueTypes, glueType_22, cases, typeReference_3, typeReference_4, typeReference_5, argument, typeReference_6, glueType_25, classDeclaration, name, functionTypeInfo, interfaceInfo, name_1, typeLiteralInfo, glueType_26, info, innerGlueType, namedTupleType, glueLiteral, functionDeclaration_1, functionDeclaration_2, members, references, members_1, utilityType, typeAliasDeclaration, mappedType;
1064
+ let matchResult, constructSignature, primitiveInfo, glueType_21, thisTypeInfo, glueTypes, glueType_22, cases, typeReference_2, typeReference_3, argument, typeReference_4, glueType_25, classDeclaration, name, functionTypeInfo, interfaceInfo, name_1, typeLiteralInfo, glueType_26, info, innerGlueType, namedTupleType, glueLiteral, functionDeclaration_1, functionDeclaration_2, members, references, members_1, utilityType, typeAliasDeclaration, mappedType;
1066
1065
  switch (glueType.tag) {
1067
1066
  case 29: {
1068
1067
  matchResult = 1;
@@ -1106,81 +1105,77 @@ function transformType(context_mut, glueType_mut) {
1106
1105
  case 13: {
1107
1106
  if (isConditionalAlias(TransformContext__get_State(context).Conditionals, glueType.fields[0].FullName)) {
1108
1107
  matchResult = 9;
1109
- typeReference_3 = glueType.fields[0];
1110
- }
1111
- else if ((typeReference_1 = glueType.fields[0], isEmpty(typeReference_1.TypeArguments) && !isEmpty(genericDelegateTypeParameters(TransformContext__get_State(context).Conditionals, typeReference_1.FullName)))) {
1112
- matchResult = 10;
1113
- typeReference_4 = glueType.fields[0];
1108
+ typeReference_2 = glueType.fields[0];
1114
1109
  }
1115
1110
  else if (mapTypeNameToFableCoreAwareName(context, glueType.fields[0]) === "obj") {
1116
- matchResult = 11;
1117
- typeReference_5 = glueType.fields[0];
1111
+ matchResult = 10;
1112
+ typeReference_3 = glueType.fields[0];
1118
1113
  }
1119
1114
  else if (glueType.fields[0].Name === "Readonly") {
1120
1115
  if (!isEmpty(glueType.fields[0].TypeArguments)) {
1121
1116
  if (isEmpty(tail_3(glueType.fields[0].TypeArguments))) {
1122
1117
  if (glueType.fields[0].IsStandardLibrary) {
1123
- matchResult = 12;
1118
+ matchResult = 11;
1124
1119
  argument = head_1(glueType.fields[0].TypeArguments);
1125
1120
  }
1126
1121
  else {
1127
- matchResult = 13;
1128
- typeReference_6 = glueType.fields[0];
1122
+ matchResult = 12;
1123
+ typeReference_4 = glueType.fields[0];
1129
1124
  }
1130
1125
  }
1131
1126
  else {
1132
- matchResult = 13;
1133
- typeReference_6 = glueType.fields[0];
1127
+ matchResult = 12;
1128
+ typeReference_4 = glueType.fields[0];
1134
1129
  }
1135
1130
  }
1136
1131
  else {
1137
- matchResult = 13;
1138
- typeReference_6 = glueType.fields[0];
1132
+ matchResult = 12;
1133
+ typeReference_4 = glueType.fields[0];
1139
1134
  }
1140
1135
  }
1141
1136
  else {
1142
- matchResult = 13;
1143
- typeReference_6 = glueType.fields[0];
1137
+ matchResult = 12;
1138
+ typeReference_4 = glueType.fields[0];
1144
1139
  }
1145
1140
  break;
1146
1141
  }
1147
1142
  case 14: {
1148
- matchResult = 14;
1143
+ matchResult = 13;
1149
1144
  glueType_25 = glueType.fields[0];
1150
1145
  break;
1151
1146
  }
1152
1147
  case 12: {
1153
- matchResult = 15;
1148
+ matchResult = 14;
1154
1149
  classDeclaration = glueType.fields[0];
1155
1150
  break;
1156
1151
  }
1157
1152
  case 16: {
1158
- matchResult = 16;
1153
+ matchResult = 15;
1159
1154
  name = glueType.fields[0];
1160
1155
  break;
1161
1156
  }
1162
1157
  case 15: {
1163
- matchResult = 17;
1158
+ matchResult = 16;
1164
1159
  functionTypeInfo = glueType.fields[0];
1165
1160
  break;
1166
1161
  }
1167
1162
  case 1: {
1168
- matchResult = 18;
1163
+ matchResult = 17;
1169
1164
  interfaceInfo = glueType.fields[0];
1170
1165
  break;
1171
1166
  }
1172
1167
  case 22: {
1173
1168
  if (isEmpty(glueType.fields[0].Members)) {
1174
- matchResult = 19;
1169
+ matchResult = 18;
1175
1170
  }
1176
1171
  else {
1177
1172
  const activePatternResult = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1178
1173
  if (activePatternResult != null) {
1179
- matchResult = 20;
1174
+ matchResult = 19;
1180
1175
  name_1 = activePatternResult;
1181
1176
  }
1182
1177
  else {
1183
- matchResult = 21;
1178
+ matchResult = 20;
1184
1179
  typeLiteralInfo = glueType.fields[0];
1185
1180
  }
1186
1181
  }
@@ -1189,11 +1184,11 @@ function transformType(context_mut, glueType_mut) {
1189
1184
  case 25: {
1190
1185
  const activePatternResult_1 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1191
1186
  if (activePatternResult_1 != null) {
1192
- matchResult = 20;
1187
+ matchResult = 19;
1193
1188
  name_1 = activePatternResult_1;
1194
1189
  }
1195
1190
  else {
1196
- matchResult = 22;
1191
+ matchResult = 21;
1197
1192
  glueType_26 = glueType.fields[0];
1198
1193
  }
1199
1194
  break;
@@ -1201,11 +1196,11 @@ function transformType(context_mut, glueType_mut) {
1201
1196
  case 2: {
1202
1197
  const activePatternResult_2 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1203
1198
  if (activePatternResult_2 != null) {
1204
- matchResult = 20;
1199
+ matchResult = 19;
1205
1200
  name_1 = activePatternResult_2;
1206
1201
  }
1207
1202
  else {
1208
- matchResult = 23;
1203
+ matchResult = 22;
1209
1204
  info = glueType.fields[0];
1210
1205
  }
1211
1206
  break;
@@ -1213,11 +1208,11 @@ function transformType(context_mut, glueType_mut) {
1213
1208
  case 9: {
1214
1209
  const activePatternResult_3 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1215
1210
  if (activePatternResult_3 != null) {
1216
- matchResult = 20;
1211
+ matchResult = 19;
1217
1212
  name_1 = activePatternResult_3;
1218
1213
  }
1219
1214
  else {
1220
- matchResult = 24;
1215
+ matchResult = 23;
1221
1216
  innerGlueType = glueType.fields[0];
1222
1217
  }
1223
1218
  break;
@@ -1225,11 +1220,11 @@ function transformType(context_mut, glueType_mut) {
1225
1220
  case 19: {
1226
1221
  const activePatternResult_4 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1227
1222
  if (activePatternResult_4 != null) {
1228
- matchResult = 20;
1223
+ matchResult = 19;
1229
1224
  name_1 = activePatternResult_4;
1230
1225
  }
1231
1226
  else {
1232
- matchResult = 25;
1227
+ matchResult = 24;
1233
1228
  namedTupleType = glueType.fields[0];
1234
1229
  }
1235
1230
  break;
@@ -1237,22 +1232,22 @@ function transformType(context_mut, glueType_mut) {
1237
1232
  case 0: {
1238
1233
  const activePatternResult_5 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1239
1234
  if (activePatternResult_5 != null) {
1240
- matchResult = 20;
1235
+ matchResult = 19;
1241
1236
  name_1 = activePatternResult_5;
1242
1237
  }
1243
1238
  else {
1244
- matchResult = 26;
1239
+ matchResult = 25;
1245
1240
  }
1246
1241
  break;
1247
1242
  }
1248
1243
  case 8: {
1249
1244
  const activePatternResult_6 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1250
1245
  if (activePatternResult_6 != null) {
1251
- matchResult = 20;
1246
+ matchResult = 19;
1252
1247
  name_1 = activePatternResult_6;
1253
1248
  }
1254
1249
  else {
1255
- matchResult = 27;
1250
+ matchResult = 26;
1256
1251
  glueLiteral = glueType.fields[0];
1257
1252
  }
1258
1253
  break;
@@ -1260,15 +1255,15 @@ function transformType(context_mut, glueType_mut) {
1260
1255
  case 6: {
1261
1256
  const activePatternResult_7 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1262
1257
  if (activePatternResult_7 != null) {
1263
- matchResult = 20;
1258
+ matchResult = 19;
1264
1259
  name_1 = activePatternResult_7;
1265
1260
  }
1266
1261
  else if (!isEmpty(glueType.fields[0].TypeParameters)) {
1267
- matchResult = 28;
1262
+ matchResult = 27;
1268
1263
  functionDeclaration_1 = glueType.fields[0];
1269
1264
  }
1270
1265
  else {
1271
- matchResult = 29;
1266
+ matchResult = 28;
1272
1267
  functionDeclaration_2 = glueType.fields[0];
1273
1268
  }
1274
1269
  break;
@@ -1276,11 +1271,11 @@ function transformType(context_mut, glueType_mut) {
1276
1271
  case 21: {
1277
1272
  const activePatternResult_8 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1278
1273
  if (activePatternResult_8 != null) {
1279
- matchResult = 20;
1274
+ matchResult = 19;
1280
1275
  name_1 = activePatternResult_8;
1281
1276
  }
1282
1277
  else {
1283
- matchResult = 30;
1278
+ matchResult = 29;
1284
1279
  members = glueType.fields[1];
1285
1280
  references = glueType.fields[0];
1286
1281
  }
@@ -1289,11 +1284,11 @@ function transformType(context_mut, glueType_mut) {
1289
1284
  case 20: {
1290
1285
  const activePatternResult_9 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1291
1286
  if (activePatternResult_9 != null) {
1292
- matchResult = 20;
1287
+ matchResult = 19;
1293
1288
  name_1 = activePatternResult_9;
1294
1289
  }
1295
1290
  else {
1296
- matchResult = 31;
1291
+ matchResult = 30;
1297
1292
  members_1 = glueType.fields[0];
1298
1293
  }
1299
1294
  break;
@@ -1301,11 +1296,11 @@ function transformType(context_mut, glueType_mut) {
1301
1296
  case 27: {
1302
1297
  const activePatternResult_10 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1303
1298
  if (activePatternResult_10 != null) {
1304
- matchResult = 20;
1299
+ matchResult = 19;
1305
1300
  name_1 = activePatternResult_10;
1306
1301
  }
1307
1302
  else {
1308
- matchResult = 32;
1303
+ matchResult = 31;
1309
1304
  utilityType = glueType.fields[0];
1310
1305
  }
1311
1306
  break;
@@ -1313,11 +1308,11 @@ function transformType(context_mut, glueType_mut) {
1313
1308
  case 5: {
1314
1309
  const activePatternResult_11 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1315
1310
  if (activePatternResult_11 != null) {
1316
- matchResult = 20;
1311
+ matchResult = 19;
1317
1312
  name_1 = activePatternResult_11;
1318
1313
  }
1319
1314
  else {
1320
- matchResult = 33;
1315
+ matchResult = 32;
1321
1316
  typeAliasDeclaration = glueType.fields[0];
1322
1317
  }
1323
1318
  break;
@@ -1325,11 +1320,11 @@ function transformType(context_mut, glueType_mut) {
1325
1320
  case 28: {
1326
1321
  const activePatternResult_12 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1327
1322
  if (activePatternResult_12 != null) {
1328
- matchResult = 20;
1323
+ matchResult = 19;
1329
1324
  name_1 = activePatternResult_12;
1330
1325
  }
1331
1326
  else {
1332
- matchResult = 34;
1327
+ matchResult = 33;
1333
1328
  mappedType = glueType.fields[0];
1334
1329
  }
1335
1330
  break;
@@ -1337,66 +1332,66 @@ function transformType(context_mut, glueType_mut) {
1337
1332
  case 10: {
1338
1333
  const activePatternResult_13 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1339
1334
  if (activePatternResult_13 != null) {
1340
- matchResult = 20;
1335
+ matchResult = 19;
1341
1336
  name_1 = activePatternResult_13;
1342
1337
  }
1343
1338
  else {
1344
- matchResult = 35;
1339
+ matchResult = 34;
1345
1340
  }
1346
1341
  break;
1347
1342
  }
1348
1343
  case 11: {
1349
1344
  const activePatternResult_14 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1350
1345
  if (activePatternResult_14 != null) {
1351
- matchResult = 20;
1346
+ matchResult = 19;
1352
1347
  name_1 = activePatternResult_14;
1353
1348
  }
1354
1349
  else {
1355
- matchResult = 36;
1350
+ matchResult = 35;
1356
1351
  }
1357
1352
  break;
1358
1353
  }
1359
1354
  case 33: {
1360
1355
  const activePatternResult_15 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1361
1356
  if (activePatternResult_15 != null) {
1362
- matchResult = 20;
1357
+ matchResult = 19;
1363
1358
  name_1 = activePatternResult_15;
1364
1359
  }
1365
1360
  else {
1366
- matchResult = 37;
1361
+ matchResult = 36;
1367
1362
  }
1368
1363
  break;
1369
1364
  }
1370
1365
  case 31: {
1371
1366
  const activePatternResult_16 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1372
1367
  if (activePatternResult_16 != null) {
1373
- matchResult = 20;
1368
+ matchResult = 19;
1374
1369
  name_1 = activePatternResult_16;
1375
1370
  }
1376
1371
  else {
1377
- matchResult = 38;
1372
+ matchResult = 37;
1378
1373
  }
1379
1374
  break;
1380
1375
  }
1381
1376
  case 32: {
1382
1377
  const activePatternResult_17 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1383
1378
  if (activePatternResult_17 != null) {
1384
- matchResult = 20;
1379
+ matchResult = 19;
1385
1380
  name_1 = activePatternResult_17;
1386
1381
  }
1387
1382
  else {
1388
- matchResult = 38;
1383
+ matchResult = 37;
1389
1384
  }
1390
1385
  break;
1391
1386
  }
1392
1387
  case 4: {
1393
1388
  const activePatternResult_18 = $007CRememberedTypeLiteral$007C_$007C(context, glueType);
1394
1389
  if (activePatternResult_18 != null) {
1395
- matchResult = 20;
1390
+ matchResult = 19;
1396
1391
  name_1 = activePatternResult_18;
1397
1392
  }
1398
1393
  else {
1399
- matchResult = 38;
1394
+ matchResult = 37;
1400
1395
  }
1401
1396
  break;
1402
1397
  }
@@ -1427,29 +1422,24 @@ function transformType(context_mut, glueType_mut) {
1427
1422
  return transformUnionType(context, cases);
1428
1423
  case 9:
1429
1424
  return FSharpType.Object$;
1430
- case 10: {
1431
- context_mut = context;
1432
- glueType_mut = (new GlueType(/* TypeReference */ 13, [new GlueTypeReference(typeReference_4.Name, typeReference_4.FullName, typeReference_4.ModulePath, map((_arg_1) => (new GlueType(/* Primitive */ 3, [GluePrimitive.Any])), genericDelegateTypeParameters(TransformContext__get_State(context).Conditionals, typeReference_4.FullName)), typeReference_4.IsStandardLibrary)]));
1433
- continue transformType;
1434
- }
1435
- case 11:
1425
+ case 10:
1436
1426
  return FSharpType.Object$;
1437
- case 12: {
1427
+ case 11: {
1438
1428
  context_mut = context;
1439
1429
  glueType_mut = argument;
1440
1430
  continue transformType;
1441
1431
  }
1432
+ case 12:
1433
+ return new FSharpType(/* TypeReference */ 11, [new FSharpTypeReference(mapTypeNameToFableCoreAwareName(context, typeReference_4), typeReference_4.FullName, typeReference_4.ModulePath, (typeReference_4.IsStandardLibrary && FSharpSet__Contains(typedArrayNames, typeReference_4.Name)) ? empty() : ((typeReference_4.IsStandardLibrary && FSharpSet__Contains(iteratorNames, typeReference_4.Name)) ? map((glueType_23) => transformType(context, glueType_23), truncate(1, typeReference_4.TypeArguments)) : map((glueType_24) => transformType(context, glueType_24), typeReference_4.TypeArguments)), FSharpType.Discard)]);
1442
1434
  case 13:
1443
- return new FSharpType(/* TypeReference */ 11, [new FSharpTypeReference(mapTypeNameToFableCoreAwareName(context, typeReference_6), typeReference_6.FullName, typeReference_6.ModulePath, (typeReference_6.IsStandardLibrary && FSharpSet__Contains(typedArrayNames, typeReference_6.Name)) ? empty() : ((typeReference_6.IsStandardLibrary && FSharpSet__Contains(iteratorNames, typeReference_6.Name)) ? map((glueType_23) => transformType(context, glueType_23), truncate(1, typeReference_6.TypeArguments)) : map((glueType_24) => transformType(context, glueType_24), typeReference_6.TypeArguments)), FSharpType.Discard)]);
1444
- case 14:
1445
1435
  return new FSharpType(/* ResizeArray */ 14, [transformType(TransformContext__PushScope_27AED5E3(context, "Item"), glueType_25)]);
1446
- case 15:
1436
+ case 14:
1447
1437
  return new FSharpType(/* TypeReference */ 11, [new FSharpTypeReference(classDeclaration.Name, classDeclaration.Name, empty(), empty(), FSharpType.Discard)]);
1448
- case 16:
1438
+ case 15:
1449
1439
  return new FSharpType(/* TypeParameter */ 13, [name]);
1450
- case 17:
1440
+ case 16:
1451
1441
  return transformFunctionType(context, functionTypeInfo);
1452
- case 18: {
1442
+ case 17: {
1453
1443
  const matchValue = tryTransformCallableInterface(context, interfaceInfo);
1454
1444
  if (matchValue == null) {
1455
1445
  return new FSharpType(/* Interface */ 5, [transformInterface(context, interfaceInfo)]);
@@ -1458,23 +1448,23 @@ function transformType(context_mut, glueType_mut) {
1458
1448
  return matchValue;
1459
1449
  }
1460
1450
  }
1461
- case 19:
1451
+ case 18:
1462
1452
  return FSharpType.Object$;
1463
- case 20:
1453
+ case 19:
1464
1454
  return new FSharpType(/* TypeReference */ 11, [new FSharpTypeReference(name_1, TransformContext__get_FullName(context), empty(), empty(), FSharpType.Discard)]);
1465
- case 21:
1455
+ case 20:
1466
1456
  return transformTypeLiteral(context, typeLiteralInfo);
1467
- case 22: {
1457
+ case 21: {
1468
1458
  context_mut = context;
1469
1459
  glueType_mut = glueType_26;
1470
1460
  continue transformType;
1471
1461
  }
1472
- case 23: {
1462
+ case 22: {
1473
1463
  context_mut = context;
1474
1464
  glueType_mut = info.Type;
1475
1465
  continue transformType;
1476
1466
  }
1477
- case 24: {
1467
+ case 23: {
1478
1468
  const matchValue_1 = TypeAliasDeclaration_tryTransformKeyOf(TransformContext__get_CurrentScopeName(context), innerGlueType);
1479
1469
  if (matchValue_1 == null) {
1480
1470
  return FSharpType.Object$;
@@ -1484,14 +1474,14 @@ function transformType(context_mut, glueType_mut) {
1484
1474
  return new FSharpType(/* TypeReference */ 11, [new FSharpTypeReference(TransformContext__get_FullName(context), TransformContext__get_FullName(context), empty(), empty(), FSharpType.Discard)]);
1485
1475
  }
1486
1476
  }
1487
- case 25: {
1477
+ case 24: {
1488
1478
  context_mut = context;
1489
1479
  glueType_mut = namedTupleType.Type;
1490
1480
  continue transformType;
1491
1481
  }
1492
- case 26:
1482
+ case 25:
1493
1483
  return FSharpType.Object$;
1494
- case 27:
1484
+ case 26:
1495
1485
  switch (glueLiteral.tag) {
1496
1486
  case 1:
1497
1487
  return new FSharpType(/* Primitive */ 8, [FSharpPrimitive.Int]);
@@ -1504,26 +1494,26 @@ function transformType(context_mut, glueType_mut) {
1504
1494
  default:
1505
1495
  return new FSharpType(/* Primitive */ 8, [FSharpPrimitive.String$]);
1506
1496
  }
1507
- case 28:
1497
+ case 27:
1508
1498
  return FSharpType.Object$;
1509
- case 29:
1499
+ case 28:
1510
1500
  return new FSharpType(/* Function */ 16, [new FSharpFunctionType(requiredBeforeParamArray(map((parameter) => transformParameter(context, parameter), functionDeclaration_2.Parameters)), transformType(context, functionDeclaration_2.Type))]);
1511
- case 30:
1501
+ case 29:
1512
1502
  return transformIntersectionOfReferences(context, references, members);
1513
- case 31:
1503
+ case 30:
1514
1504
  return transformIntersectionType(context, members_1);
1515
- case 32:
1505
+ case 31:
1516
1506
  return UtilityType_transform(context, utilityType);
1517
- case 33:
1507
+ case 32:
1518
1508
  return new FSharpType(/* Mapped */ 7, [new FSharpMapped(typeAliasDeclaration.Name, empty())]);
1519
- case 34:
1509
+ case 33:
1520
1510
  return transformMappedType(context, mappedType);
1511
+ case 34:
1512
+ return FSharpType.Object$;
1521
1513
  case 35:
1522
1514
  return FSharpType.Object$;
1523
1515
  case 36:
1524
1516
  return FSharpType.Object$;
1525
- case 37:
1526
- return FSharpType.Object$;
1527
1517
  default: {
1528
1518
  TransformContext__AddError_Z721C83C5(context, `Could not transform type: ${interpolate("%A%P()", [glueType])}`);
1529
1519
  return FSharpType.Discard;
@@ -3599,8 +3589,8 @@ function transformInterface(context, info) {
3599
3589
  return !contains_2(_arg_2.fields[0].Name, ownNames);
3600
3590
  }
3601
3591
  }, append(membersComingFromPartial, append(membersComingFromOmit, membersComingFromCallable))))), toList(delay(() => {
3602
- let context_2;
3603
- return append_1(List_distinct(filter(isInheritableType, map((context_2 = TransformContext__PushScope_27AED5E3(context_1, "Extends"), (glueType_1) => transformType(context_2, glueType_1)), inheritance)), {
3592
+ let list_19, context_2;
3593
+ return append_1(List_distinct(filter(isInheritableType, (list_19 = withoutBasesOfBases(TransformContext__get_TypeMemory(context_1), inheritance), map((context_2 = TransformContext__PushScope_27AED5E3(context_1, "Extends"), (glueType_1) => transformType(context_2, glueType_1)), list_19))), {
3604
3594
  Equals: equals,
3605
3595
  GetHashCode: (x_2) => (safeHash(x_2) | 0),
3606
3596
  }), delay(() => {
@@ -5038,16 +5028,15 @@ function aliasOfUtilityType(scope, utilityType) {
5038
5028
 
5039
5029
  function aliasOfFunctionType(scope, functionType) {
5040
5030
  const context = scope.Context;
5041
- const declaredNames = ofSeq(map((_arg) => _arg.Name, scope.Declaration.TypeParameters), {
5042
- Compare: (x, y) => (comparePrimitives(x, y) | 0),
5043
- });
5044
- const ownTypeParameters = transformTypeParameters(context, filter((typeParameter) => !FSharpSet__Contains(declaredNames, typeParameter.Name), functionType.TypeParameters));
5031
+ const ownDefaults = ownTypeParameterDefaults(functionType);
5032
+ const parameters = map((parameter) => GlueSubstitution_substituteParameter(ownDefaults, parameter), functionType.Parameters);
5033
+ const returnType = GlueSubstitution_substitute(ownDefaults, functionType.Type);
5045
5034
  const declaredTypeParameters = scope.TypeParameters.Value.TypeParameters;
5046
- if (isLambdaSignature(functionType.Parameters, ownTypeParameters.TypeParameters, declaredTypeParameters)) {
5047
- return aliasOf(scope, new FSharpType(/* Function */ 16, [new FSharpFunctionType(map((parameter) => transformParameter(context, parameter), functionType.Parameters), transformCallbackReturnType(TransformContext__PushScope_27AED5E3(context, "ReturnType"), functionType.Type))]));
5035
+ if (isLambdaSignature(parameters, empty(), declaredTypeParameters)) {
5036
+ return aliasOf(scope, new FSharpType(/* Function */ 16, [new FSharpFunctionType(map((parameter_1) => transformParameter(context, parameter_1), parameters), transformCallbackReturnType(TransformContext__PushScope_27AED5E3(context, "ReturnType"), returnType))]));
5048
5037
  }
5049
5038
  else {
5050
- return new FSharpType(/* Delegate */ 20, [new FSharpDelegate(scope.XmlDoc.XmlDoc, scope.Name, append(declaredTypeParameters, ownTypeParameters.TypeParameters), requiredBeforeParamArray(map((arg) => TypeParameter_mapFsharpParameter(ownTypeParameters.SealedTypes, transformParameter(context, arg)), functionType.Parameters)), TypeParameter_mapFSharpType(ownTypeParameters.SealedTypes, transformCallbackReturnType(TransformContext__PushScope_27AED5E3(context, "ReturnType"), functionType.Type)))]);
5039
+ return new FSharpType(/* Delegate */ 20, [new FSharpDelegate(scope.XmlDoc.XmlDoc, scope.Name, declaredTypeParameters, requiredBeforeParamArray(map((parameter_2) => transformParameter(context, parameter_2), parameters)), transformCallbackReturnType(TransformContext__PushScope_27AED5E3(context, "ReturnType"), returnType))]);
5051
5040
  }
5052
5041
  }
5053
5042
 
@@ -5703,7 +5692,7 @@ function transformToFsharp(context, glueTypes) {
5703
5692
  return transformModuleDeclaration(TransformContext__get_TypeMemory(context), TransformContext__get_State(context), TransformContext__get__Reporter(context), TransformContext__get_TypeLiteralsMemory(context), TransformContext__get_ImportSource(context), moduleInfo);
5704
5693
  case 5: {
5705
5694
  const name_1 = sanitizeTypeName(fileModule.Name);
5706
- TypeLiteralsMemory__EnterModule_Z721C83C5(TransformContext__get_TypeLiteralsMemory(context), name_1);
5695
+ TypeLiteralsMemory__EnterFileModule_Z721C83C5(TransformContext__get_TypeLiteralsMemory(context), name_1);
5707
5696
  const types = transform(TransformContext__get_TypeMemory(context), TransformContext__get_State(context), TransformContext__get__Reporter(context), TransformContext__get_TypeLiteralsMemory(context), fileModule.IsGlobal ? ImportSource.Global : (!fileModule.HasRuntime ? ImportSource.NoRuntime : (new ImportSource(/* Module */ 0, [fileModule.ImportSpecifier, fileModule.SymbolSpecifiers]))), true, fileModule.Types);
5708
5697
  TypeLiteralsMemory__LeaveModule(TransformContext__get_TypeLiteralsMemory(context));
5709
5698
  return singleton(new FSharpType(/* Module */ 4, [new FSharpModule(name_1, false, fileModule.ImportSpecifier, append(types, aggregatedExports(types)))]));
@@ -5946,7 +5935,7 @@ function transform(typeMemory, state, reporter, typeLiteralsMemory, importSource
5946
5935
  return true;
5947
5936
  case 11: {
5948
5937
  const info_11 = glueType_7.fields[0];
5949
- if (!info_11.IsGlobal) {
5938
+ if (!info_11.IsGlobal && info_11.IsExported) {
5950
5939
  return applyModuleDeclaration(info_11);
5951
5940
  }
5952
5941
  else {
@@ -2,10 +2,10 @@
2
2
  import { Union, Record } from "../../fable_modules/fable-library-js.5.17.2/Types.js";
3
3
  import { GlueFunctionDeclaration, GlueProperty, GlueMethodSignature, GlueMember, GlueMethod, GlueTypeParameter, GlueParameter_$reflection, GlueTypeParameter_$reflection, GlueFunctionType, GlueParameter, GlueTypeUnion, GlueTypeReference, GlueSubstitution_mentionedTypeParameters, GlueConditionalType, GlueSubstitution_substitute, GlueType, GluePrimitive, GlueClassDeclaration_$reflection, GlueInterface_$reflection, GlueTypeAliasDeclaration_$reflection, GlueType_$reflection } from "../GlueAST.js";
4
4
  import { union_type, record_type, class_type, string_type, list_type } from "../../fable_modules/fable-library-js.5.17.2/Reflection.js";
5
- import { collect as collect_1, append, choose, singleton, cons, tryPick, zip, length, head as head_2, tail, item, mapIndexed, ofArray, forAll, empty as empty_1, contains, filter, isEmpty, map as map_1, exists, iterate } from "../../fable_modules/fable-library-js.5.17.2/List.js";
5
+ import { collect as collect_1, append, empty as empty_1, choose, singleton, cons, tryPick, zip, length, head as head_2, tail, item, mapIndexed, ofArray, filter, contains, forAll, isEmpty, map as map_1, exists, iterate } from "../../fable_modules/fable-library-js.5.17.2/List.js";
6
6
  import { ofSeq as ofSeq_1, add, empty, FSharpSet__Contains, FSharpSet__Add } from "../../fable_modules/fable-library-js.5.17.2/Set.js";
7
7
  import { getItemFromDict } from "../../fable_modules/fable-library-js.5.17.2/MapUtil.js";
8
- import { safeHash, equals, stringHash, comparePrimitives, disposeSafe, getEnumerator, curry2 } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
8
+ import { safeHash, stringHash, equals, comparePrimitives, disposeSafe, getEnumerator, curry2 } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
9
9
  import { empty as empty_2, FSharpMap__get_IsEmpty, FSharpMap__get_Item, FSharpMap__TryFind, ofList, FSharpMap__ContainsKey, ofSeq } from "../../fable_modules/fable-library-js.5.17.2/Map.js";
10
10
  import { map } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
11
11
  import { defaultArg } from "../../fable_modules/fable-library-js.5.17.2/Option.js";
@@ -223,68 +223,6 @@ export function isInterfaceDeclaration(state, fullName) {
223
223
  }
224
224
  }
225
225
 
226
- /**
227
- * The type parameters of the function type `type Fn = <T>(value: T) => T` aliases
228
- */
229
- export function genericDelegateTypeParameters(state, fullName) {
230
- const matchValue = FSharpMap__TryFind(state.AllAliases, fullName);
231
- let matchResult, alias_1;
232
- if (matchValue != null) {
233
- if (isEmpty(matchValue.TypeParameters)) {
234
- matchResult = 0;
235
- alias_1 = matchValue;
236
- }
237
- else {
238
- matchResult = 1;
239
- }
240
- }
241
- else {
242
- matchResult = 1;
243
- }
244
- switch (matchResult) {
245
- case 0: {
246
- const matchValue_1 = alias_1.Type;
247
- if (matchValue_1.tag === 15) {
248
- const functionType = matchValue_1.fields[0];
249
- return map_1((_arg) => _arg.Name, filter((typeParameter) => {
250
- if (contains(typeParameter.Name, functionType.OwnTypeParameterNames, {
251
- Equals: (x, y) => (x === y),
252
- GetHashCode: (x) => (stringHash(x) | 0),
253
- })) {
254
- const matchValue_2 = typeParameter.Constraint;
255
- let matchResult_1;
256
- if (matchValue_2 != null) {
257
- if (matchValue_2.tag === 13) {
258
- matchResult_1 = 0;
259
- }
260
- else {
261
- matchResult_1 = 1;
262
- }
263
- }
264
- else {
265
- matchResult_1 = 0;
266
- }
267
- switch (matchResult_1) {
268
- case 0:
269
- return true;
270
- default:
271
- return false;
272
- }
273
- }
274
- else {
275
- return false;
276
- }
277
- }, functionType.TypeParameters));
278
- }
279
- else {
280
- return empty_1();
281
- }
282
- }
283
- default:
284
- return empty_1();
285
- }
286
- }
287
-
288
226
  function tryCollapse(resolve_1, conditionalType) {
289
227
  let head;
290
228
  const trueType = equals(conditionalType.TrueType, conditionalType.CheckType) ? conditionalType.ExtendsType : conditionalType.TrueType;