www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Assertion failure: 'f' on line 2695 in file 'expression.c'

reply J C Calvarese <jcc7 cox.net> writes:
This code (cut down from Mike Parker's Derelict project) causes an 
assertion in the compiler:
Assertion failure: 'f' on line 2695 in file 'expression.c'



private import std.loader;

struct SDL_version {}
void SDL_VERSION(SDL_version* X) {}

extern(C):
typedef SDL_version* function() pfSDL_lv();
pfSDL_lv        SDL_lv;


private HXModule hsdl;

public void DSDL_Load()
{
	SDL_lv = cast(pfSDL_lv) ExeModule_GetSymbol(hsdl, "SDL_lv");
}

/+ lv = Linked_Version +/


-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
Jun 09 2004
parent reply J C Calvarese <jcc7 cox.net> writes:
J C Calvarese wrote:
 This code (cut down from Mike Parker's Derelict project) causes an 
 assertion in the compiler:
 Assertion failure: 'f' on line 2695 in file 'expression.c'
Here's a shorter version (same problem): struct v {} typedef v* function() p(); p pvar; void* Get() { return null; } void Load() { pvar = cast(p) Get(); } -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jun 09 2004
parent Mike Parker <aldacron71 yahoo.com> writes:
J C Calvarese wrote:
 J C Calvarese wrote:
 
 This code (cut down from Mike Parker's Derelict project) causes an 
 assertion in the compiler:
 Assertion failure: 'f' on line 2695 in file 'expression.c'
Here's a shorter version (same problem): struct v {} typedef v* function() p(); p pvar; void* Get() { return null; } void Load() { pvar = cast(p) Get(); }
I've worked it out. The problem is the extra set of parentheses after the function name in the declaration: typedef v* function() p(); ^ here A typo, of course <blush>. So is this a situation where the compiler should spit out an error along the lines of "Expected ; found ()"?
Jun 10 2004