DEADSOFTWARE

JVM: Реализованы VAR-параметры
[dsw-obn.git] / src / oberon.c
index e4b9157d151cafa6075c86bbc1a07ebf2e845bef..58eb67c3eb72562294074f972fde2e15f68b5fec 100644 (file)
@@ -1223,13 +1223,21 @@ oberon_autocast_call(oberon_context_t * ctx, oberon_item_t * desig)
        {
                if(param -> class == OBERON_CLASS_VAR_PARAM)
                {
+                       if(arg -> result != param -> type)
+                       {
+                               oberon_error(ctx, "incompatible type");
+                       }
                        if(arg -> read_only)
                        {
                                oberon_error(ctx, "assign to read-only var");
                        }
+                       casted[i] = arg;
+               }
+               else
+               {
+                       casted[i] = oberon_autocast_to(ctx, arg, param -> type);
                }
 
-               casted[i] = oberon_autocast_to(ctx, arg, param -> type);
                arg = arg -> next;
                param = param -> next;
        }