Euphoria
Ticket #115:
not sequence(s) fails on translator
-
Reported by
jimcbrown
Nov 09, 2009
As reported in ticket #114 and #112, the translator does not correctly handle the if statement of "if not sequence(s) then" when "object s" is assigned a sequence.
The current code that demonstrates this problem, in std/dll.e call_back(), is currently ifdef'd out for the translator. Removing the ifdef will expose the problem.
Details
1. Comment by mattlewis
Nov 09, 2009
This should be fixed now. The problem is, once again, the fact that we might return a sequence instead of a callback (why, oh why?). The translator can predict the type returned by a machine func, but now that callbacks don't do what you'd expect them to, we need to change that in the translator (see compile.e:machine_func_type).
I only made the translator change. I'll let others do whatever needs to be done with dll.e be done.
2. Comment by jimcbrown
Nov 09, 2009
I just reverted the fix I put in in r2992, so now someone with Windows can test the translator on a program that uses callbacks to confirm that this works.
The part that irks is all the fixes will need to be reverted again once DEP is moved to the C backend proper.
3. Comment by ne1uno
Nov 11, 2009
is object(x) failing translated a similar problem? I noticed the object() tests in t_obbject.e are intentionally ifdef'ed around when translated. and I find some of my own object() tests fail when translated, turning use of object() into a potential latent bug.
4. Comment by mattlewis
Nov 11, 2009
The object() issue is different. I think we can fix this. The issue is that in the translator, variables are initialized to 0, but in the interpreter, NOVALUE (which is what the object() test looks for). Open another ticket on that issue. It's not completely trivial, because there are probably places in the code that rely on the initialization, but I doubt it's too difficult.
5. Comment by ne1uno
Nov 12, 2009
created ticket for object() fails when translated.
callbacks in r3006 watcom or minGW appear to work no different than earlier.