summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--struct.c8
-rw-r--r--txr.15
2 files changed, 9 insertions, 4 deletions
diff --git a/struct.c b/struct.c
index 9de7d0c5..054b5f09 100644
--- a/struct.c
+++ b/struct.c
@@ -263,8 +263,12 @@ val super(val type)
val stype = find_struct_type(type);
if (!stype)
no_such_struct(lit("super"), type);
- return super(stype);
- } else {
+ type = stype;
+ } else if (structp(type)) {
+ type = struct_type(type);
+ }
+
+ {
struct struct_type *st = coerce(struct struct_type *,
cobj_handle(type, struct_type_s));
return st->super;
diff --git a/txr.1 b/txr.1
index e2f631a4..c57548a7 100644
--- a/txr.1
+++ b/txr.1
@@ -18388,8 +18388,9 @@ has no supertype.
The
.meta type
-must be either a struct type object, or else
-a symbol which names a struct type.
+argument must be either a struct type object, a
+a symbol which names a struct type (which is resolved to that type),
+or else a structure instance (which is resolved to its structure type).
.coNP Function @ make-struct
.synb