Skip to content

Commit

Permalink
Unify some record error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Apr 13, 2018
1 parent d303b43 commit 352fda4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/precord.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Obj ElmPRec (
return GET_ELM_PREC( rec, i );
else {
ErrorReturnVoid(
"Record: '<rec>.%g' must have an assigned value",
"Record Element: '<rec>.%g' must have an assigned value",
(Int)NAME_RNAM(rnam), 0L,
"you can 'return;' after assigning a value" );
return ELM_REC( rec, rnam );
Expand Down Expand Up @@ -424,7 +424,7 @@ void AssPRec (
// Accept T_PREC and T_COMOBJ, reject T_PREC+IMMUTABLE
if (TNUM_OBJ(rec) == T_PREC+IMMUTABLE) {
ErrorReturnVoid(
"Records Assignment: <rec> must be a mutable record",
"Record Assignment: <rec> must be a mutable record",
0L, 0L,
"you can 'return;' and ignore the assignment" );
}
Expand Down
4 changes: 2 additions & 2 deletions src/records.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ Int IsbRecError (
UInt rnam )
{
rec = ErrorReturnObj(
"IsBound: <rec> must be a record (not a %s)",
"Record IsBound: <rec> must be a record (not a %s)",
(Int)TNAM_OBJ(rec), 0L,
"you can replace <rec> via 'return <rec>;'" );
return ISB_REC( rec, rnam );
Expand Down Expand Up @@ -509,7 +509,7 @@ void UnbRecError (
UInt rnam )
{
rec = ErrorReturnObj(
"Unbind: <rec> must be a record (not a %s)",
"Record Unbind: <rec> must be a record (not a %s)",
(Int)TNAM_OBJ(rec), 0L,
"you can replace <rec> via 'return <rec>;'" );
UNB_REC( rec, rnam );
Expand Down
2 changes: 1 addition & 1 deletion tst/testinstall/function.tst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ gap> Info(InfoWarning, 1000, f());
gap> r.(f());
Error, Function call: <func> must return a value
gap> r.(g());
Error, Record: '<rec>.2' must have an assigned value
Error, Record Element: '<rec>.2' must have an assigned value
gap> (function() end)();
gap> (function() return 2; end)();
2
Expand Down
4 changes: 2 additions & 2 deletions tst/testinstall/recordname.tst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ rec( x := 2 )
gap> Unbind(x.x);
Error, Record Unbind: <rec> must be a mutable record
gap> x.y := 2;
Error, Records Assignment: <rec> must be a mutable record
Error, Record Assignment: <rec> must be a mutable record
gap> x.x := 2;
Error, Records Assignment: <rec> must be a mutable record
Error, Record Assignment: <rec> must be a mutable record
gap> r := rec(x := 2, y := 3);
rec( x := 2, y := 3 )
gap> r.x;
Expand Down

0 comments on commit 352fda4

Please sign in to comment.