temperlang / temper

3 stars 0 forks source link

Java Backend makes unknown vFunction for join on certain functions. #87

Open ShawSumma opened 8 months ago

ShawSumma commented 8 months ago

Not sure if this is related to the lambda changes that are happening to java.

temper build -b java cannot handle certain functions being passed into others.

let idString(idStringValue: String): String {
  return idStringValue;
}

class Cat {
  public name: String;

  public title(): String {
    var strs = new ListBuilder<String>();
    strs.add(name);
    strs.add("the");
    strs.add("Cat");
    return strs.join(" ", idString);
  }
}

This example passes idString into join... which fail only when building for java.

This is very likely related to #63 but distinct because it does not happen with only fn/block lambdas but any function arg.

tjpalmer commented 8 months ago

The general issue, to the extent I understand it, is that names invented during tmpl translation aren't pre-accounted for in the new naming. And certain code organizations end up creating new function names during tmpl translation. Why that's happening here specifically, I'm unsure.