diff --git a/src/oberon.c b/src/oberon.c
index 1f33a03c9d82bc084e3ffb1b38777b6750bc9c2f..59a5c3d5fa7f6f11dc9e65e6b1974f59fca12770 100644 (file)
--- a/src/oberon.c
+++ b/src/oberon.c
{
oberon_error(ctx, "function result is not type");
}
+ if(typeobj -> type -> class == OBERON_TYPE_RECORD
+ || typeobj -> type -> class == OBERON_TYPE_ARRAY)
+ {
+ oberon_error(ctx, "records or arrays could not be result of function");
+ }
signature -> base = typeobj -> type;
}
}
index = oberon_ident_item(ctx, iname);
oberon_assert_token(ctx, ASSIGN);
from = oberon_expr(ctx);
- oberon_assign(ctx, from, index);
oberon_assert_token(ctx, TO);
bound = oberon_make_temp_var_item(ctx, index -> result);
to = oberon_expr(ctx);
- oberon_assign(ctx, to, bound);
+ oberon_assign(ctx, to, bound); // сначала temp
+ oberon_assign(ctx, from, index); // потом i
if(ctx -> token == BY)
{
oberon_assert_token(ctx, BY);