Dechenjm / crack-language

Automatically exported from code.google.com/p/crack-language
Other
0 stars 0 forks source link

Array.map doesn't work for functions defined in other modules #95

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to execute
import crack.runtime sinf;
import crack.cont.array Array;
Array[float] f = [0.0, 1.0, 2.0];

f.map(sinf);

results in:
Referencing function in another module!
  invoke void %13(%"struct.crack.cont.array.Array[.builtin.float].Array"* %7, float (float)* @sinf10)
          to label %l8 unwind label %lp10
etc.

Original issue reported on code.google.com by Conrad.S...@gmail.com on 17 Feb 2012 at 8:09

GoogleCodeExporter commented 9 years ago
This is actually a more general problem, if we have module mod.crk containing:
  void f() {}

Then this fails similarly:
  import mod f;
  function[void] x = f;

I'm guessing that we're not applying module translation when we treat a 
function as a variable.

Original comment by mind...@gmail.com on 21 Feb 2012 at 6:10

GoogleCodeExporter commented 9 years ago

Original comment by Conrad.S...@gmail.com on 23 May 2012 at 6:28