-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypes.fs
53 lines (44 loc) · 1.14 KB
/
Types.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module Compiler.Types
open Ast
type Type =
{
IsStatic : bool
BaseType : Type option
DeclaredConstructors : Constructor list
Identifier : TypeIdentifier
GenericParameters : GenericParameterInfo list
ImplementedInterfaces : Type list
Methods : Function list
Fields : Field list
NestedTypes : Type list
}
member x.BaseTypes = Option.toList x.BaseType @ x.ImplementedInterfaces
and TypeRef =
| ConstructedType of TypeIdentifier
| GenericParameter of GenericParameterInfo
| GenericTypeDefinition of TypeIdentifier
and GenericParameterInfo = GenericTypeDeclarationPlace * int
and GenericTypeDeclarationPlace =
| Class
| Method
and Function = {
Name : string
Parameters : Parameter list
GenericParameters : GenericParameterInfo list
ReturnType : TypeRef option
IsStatic : bool
}
and Constructor = {
Parameters : Parameter list
}
and Parameter = {
Type : TypeRef;
ParameterName : string
}
and Field = {
FieldDeclaringType : TypeIdentifier
TypeRef : TypeRef
FieldName : string
IsStatic : bool
IsReadOnly : bool
}