view runtime/proghead.inc @ 331:61f5b794d939

Breaking change: method call syntax now always uses the syntactic receiver as the actual receiver. This makes its behavior different from function call syntax, but solves some problems with methods being shadowed by local variables and the like.
author Michael Pavone <pavone@retrodev.com>
date Sat, 28 Mar 2015 14:21:04 -0700
parents 632667d95d35
children
line wrap: on
line source

#include "object.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <gc/gc.h>

object * main_module;

char * methodNames[];

object * no_impl(uint32_t method_id, uint32_t num_args, object * self, va_list args)
{
	uint32_t *cur;
	int slot;
	fprintf(stderr, "method %s(%d) is not implemented on object %p\n", methodNames[method_id], method_id, self);
	fputs("Object implements:\n", stderr);
	for (slot = 0; slot < 16; slot++) {
		if (self->meta->methods[slot]) {
			for (cur = self->meta->methods[slot]; *cur != LAST_METHOD; cur++) {
				fprintf(stderr, "\t%s\n", methodNames[*cur]);
			}
		}
	}
	exit(1);
	return NULL;
}