summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-11-27 18:36:36 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2019-11-27 18:36:36 -0500
commite2bac7ba27e82cd3c249b577f363fa8c3fca0092 (patch)
tree5bfa2890a0375df09681525802cc232fa644e3eb /types.h
parent7c232ad8c766eef3b498900803bbbe01e865de8c (diff)
fixed problem where functions could have tuple parameters
Diffstat (limited to 'types.h')
-rw-r--r--types.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/types.h b/types.h
index ec9d79f..323c792 100644
--- a/types.h
+++ b/types.h
@@ -363,6 +363,8 @@ typedef struct Type {
struct {
Field *fields;
size_t size; /* size of this struct during compile time */
+ struct Declaration *params; /* parameters to struct, NULL if this struct has no parameters */
+ struct Instance *instance; /* instance of struct, NULL if this is not an instance. set during resolution. */
} struc;
};
} Type;
@@ -523,8 +525,10 @@ typedef struct FnExpr {
typedef struct Instance {
Value val;
- /* this holds the typed function */
- FnExpr fn;
+ union {
+ FnExpr fn; /* the typed function */
+ Type struc; /* the structure, resolved */
+ };
struct {
U64 id;
} c;