Commit 1908da1 1 parent c2714b9 commit 1908da1 Copy full SHA for 1908da1
File tree 11 files changed +55
-1
lines changed
11 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -372,5 +372,6 @@ type FSharpType =
372
372
| ThisType of typeName : string
373
373
| Function of FSharpFunctionType
374
374
| Class of FSharpClass
375
+ | Object
375
376
376
377
type FSharpOutFile = { Name: string ; Opens: string list }
Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ type GlueType =
210
210
| IntersectionType of GlueMember list
211
211
| TypeLiteral of GlueTypeLiteral
212
212
| OptionalType of GlueType
213
+ | Unknown
213
214
214
215
member this.Name =
215
216
match this with
@@ -245,4 +246,5 @@ type GlueType =
245
246
| FunctionType _
246
247
| TupleType _
247
248
| OptionalType _ // TODO: Should we take the name of the underlying type and add option to it?
248
- | Discard -> " obj"
249
+ | Discard
250
+ | Unknown -> " obj"
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ let private printAttributes
164
164
165
165
let rec private printType ( fsharpType : FSharpType ) =
166
166
match fsharpType with
167
+ | FSharpType.Object -> " obj"
167
168
| FSharpType.Mapped info -> info.Name
168
169
| FSharpType.Union info ->
169
170
let cases =
@@ -733,6 +734,7 @@ let rec print (printer: Printer) (fsharpTypes: FSharpType list) =
733
734
734
735
| FSharpType.Mapped _
735
736
| FSharpType.Primitive _
737
+ | FSharpType.Object
736
738
| FSharpType.TypeReference _
737
739
| FSharpType.Option _
738
740
| FSharpType.ResizeArray _
Original file line number Diff line number Diff line change @@ -318,6 +318,8 @@ let readTypeNode
318
318
319
319
reader.ReadTypeOperatorNode typeOperatorNode
320
320
321
+ | Ts.SyntaxKind.UnknownKeyword -> GlueType.Unknown
322
+
321
323
| _ ->
322
324
generateReaderError
323
325
" type node"
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ let rec private transformType
123
123
: FSharpType
124
124
=
125
125
match glueType with
126
+ | GlueType.Unknown -> FSharpType.Object
127
+
126
128
| GlueType.Primitive primitiveInfo ->
127
129
transformPrimitive primitiveInfo |> FSharpType.Primitive
128
130
@@ -1258,6 +1260,18 @@ let private transformTypeAliasDeclaration
1258
1260
}
1259
1261
|> FSharpType.Interface
1260
1262
1263
+ | GlueType.Unknown ->
1264
+ ({
1265
+ Name = typeAliasName
1266
+ Type = FSharpType.Object
1267
+ TypeParameters =
1268
+ transformTypeParameters
1269
+ context
1270
+ glueTypeAliasDeclaration.TypeParameters
1271
+ }
1272
+ : FSharpTypeAlias)
1273
+ |> FSharpType.TypeAlias
1274
+
1261
1275
| GlueType.ClassDeclaration _
1262
1276
| GlueType.Enum _
1263
1277
| GlueType.Interface _
@@ -1350,6 +1364,7 @@ let rec private transformToFsharp
1350
1364
| GlueType.Literal _
1351
1365
| GlueType.Variable _
1352
1366
| GlueType.Primitive _
1367
+ | GlueType.Unknown
1353
1368
| GlueType.KeyOf _
1354
1369
| GlueType.Discard
1355
1370
| GlueType.TupleType _
Original file line number Diff line number Diff line change @@ -299,6 +299,8 @@ type FSharpASTViewer =
299
299
( context : NodeContext < 'Msg >)
300
300
=
301
301
match fsharpType with
302
+ | FSharpType.Object -> ASTViewer.renderValueOnly " Object" context
303
+
302
304
| FSharpType.Interface interfaceInfo ->
303
305
ASTViewer.renderNode
304
306
" Interface"
Original file line number Diff line number Diff line change @@ -155,6 +155,8 @@ type GlueASTViewer =
155
155
( context : NodeContext < 'Msg >)
156
156
=
157
157
match glueType with
158
+ | GlueType.Unknown -> ASTViewer.renderValueOnly " Unknown" context
159
+
158
160
| GlueType.Variable variableInfo ->
159
161
ASTViewer.renderNode
160
162
" Variable"
Original file line number Diff line number Diff line change
1
+ export type MyType = unknown
Original file line number Diff line number Diff line change
1
+ module rec Glutinum
2
+
3
+ open Fable.Core
4
+ open Fable.Core .JsInterop
5
+ open System
6
+
7
+ type MyType =
8
+ obj
9
+
10
+ (***)
11
+ #r " nuget: Fable.Core"
12
+ (***)
Original file line number Diff line number Diff line change
1
+ export const version : unknown ;
Original file line number Diff line number Diff line change
1
+ module rec Glutinum
2
+
3
+ open Fable.Core
4
+ open Fable.Core .JsInterop
5
+ open System
6
+
7
+ [<Erase>]
8
+ type Exports =
9
+ [<Import( " version" , " module" ) >]
10
+ static member inline version : obj = nativeOnly
11
+
12
+ (***)
13
+ #r " nuget: Fable.Core"
14
+ (***)
You can’t perform that action at this time.
0 commit comments