Thread overview | |||||
---|---|---|---|---|---|
|
June 09, 2004 Assertion failure: 'f' on line 2695 in file 'expression.c' | ||||
---|---|---|---|---|
| ||||
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/
|
June 10, 2004 Re: Assertion failure: 'f' on line 2695 in file 'expression.c' | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | 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/ |
June 10, 2004 Re: Assertion failure: 'f' on line 2695 in file 'expression.c' | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | 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 ()"?
|
Copyright © 1999-2021 by the D Language Foundation