Actions
Defect #763
closedExternal procedure returning REAL32 fails to compile
Status:
Closed
Priority:
Normal
Category:
Oberon Front-End
Target version:
-
% Done:
100%
Description
The following simplified code with is part of a SDL3 wrapper library:
libsdl3.cpp:
// SDL3 API wrapper for Linux #include <def/linuxlib> LIBRARY (sdl3, "libSDL3.so") #define SDL3FUNCTION(name, parameters) FUNCTION (sdl3, name, parameters) SDL3FUNCTION (SDL_rand, 1) SDL3FUNCTION (SDL_randf, 0)
SDL3.mod:
MODULE SDL3; IMPORT SYSTEM; TYPE PCHAR* = POINTER TO VAR- CHAR; TYPE STRING* = POINTER TO ARRAY OF CHAR; TYPE Sint32* = SIGNED32; TYPE Sint64* = SIGNED64; TYPE Uint8* = UNSIGNED8; TYPE Uint16* = UNSIGNED16; TYPE Uint32* = UNSIGNED32; TYPE Uint64* = UNSIGNED64; PROCEDURE ^ rand* ["SDL_rand"] (n : Sint32): Sint32; PROCEDURE ^ randf* ["SDL_randf"] (): REAL32; END SDL3.
Test.mod:
MODULE Test;
IMPORT SDL3;
PROCEDURE Test;
BEGIN
TRACE(SDL3.rand(100));
TRACE(SDL3.rand(100));
TRACE(SDL3.rand(100));
TRACE(SDL3.randf());
TRACE(SDL3.randf());
TRACE(SDL3.randf());
END Test;
BEGIN
Test;
END Test.
Commenting out the randf procedure this works, but
with randf this fails to compile with the following error:
obamd64: obemitter.cpp:1010: ECS::Oberon::Emitter::Context::Complex ECS::Oberon::Emitter::Context::EvaluateComplex(const ECS::Oberon::Expression&): Assertion `IsComplex (*expression.type)' failed. Aborted
This used to work with the previous release of ECS and I created these files to isolate this case.
Files
Actions