diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-16 20:55:29 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-03-16 20:55:29 -0700 |
commit | 2251849ef9a2be3f487b6a4cf7926dae87cc8414 (patch) | |
tree | 113ecc6ffe0eaf4f3a067adc7edaf44fe6b7df70 /struct.c | |
parent | a84c57637e8a35cd3f16fec94bbc43f68cd41eb3 (diff) | |
download | txr-2251849ef9a2be3f487b6a4cf7926dae87cc8414.tar.gz txr-2251849ef9a2be3f487b6a4cf7926dae87cc8414.tar.bz2 txr-2251849ef9a2be3f487b6a4cf7926dae87cc8414.zip |
Fix misleading "no such slot" for static slot lookup.
* struct.c (no_such_static_slot): New static function.
(static_slot, static_slot_set): Use no_such_static_slot
when reporting error. The struct type might have an
instance slot of that name.
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -868,6 +868,12 @@ static noreturn void no_such_slot(val ctx, val type, val slot) ctx, type, slot, nao); } +static noreturn void no_such_static_slot(val ctx, val type, val slot) +{ + uw_throwf(error_s, lit("~a: ~s has no static slot named ~s"), + ctx, type, slot, nao); +} + val slot(val strct, val sym) { const val self = lit("slot"); @@ -929,7 +935,7 @@ val static_slot(val stype, val sym) return deref(ptr); } - no_such_slot(self, stype, sym); + no_such_static_slot(self, stype, sym); } val static_slot_set(val stype, val sym, val newval) @@ -946,7 +952,7 @@ val static_slot_set(val stype, val sym, val newval) } } - no_such_slot(self, stype, sym); + no_such_static_slot(self, stype, sym); } val test_dirty(val strct) |