GLBasic forum

Main forum => Bug Reports => Topic started by: bigsofty on 2010-Oct-04

Title: "conversion from `int' to non-scalar type" error
Post by: bigsofty on 2010-Oct-04
Messing around with types...

A function, within a type, that returns a type, seems to have two returns in the C++, the spare one is always "return 0", which is causing the error.

Code (glbasic) Select
// ------------------------ //
Expl Expl::Create(DGInt x, DGInt y, DGInt h)
{
   __PPRegisterFunction
REGISTER_VAR(Expl, ex);
ex.x = x;
ex.y =y;
ex.scale = h;
DIMPUSH (EXP_LIST,  ex);
return ex;
return 0; <-------------------------------------- Always added to all funcs that return a type
}
#undef __FKT
#define __FKT __g_dbg_cont


Cheers,


Ian
Title: Re: "conversion from `int' to non-scalar type" error
Post by: Kitty Hello on 2010-Oct-14
OK in the next update that will be fixed. Also the warning about an unknown type when you declare them later.
Title: Re: "conversion from `int' to non-scalar type" error
Post by: bigsofty on 2010-Oct-14
Thanks Gernot, I converted quite a large library over to the new type system but this error was pretty much a 'show stopper'.

Cheers,


Ian