#2098 JS: Static const Func not immutable

bedla Mon 11 Feb 2013

Hi,

I am playing around with static const func and found strange behaviour. I have following test case. When running with fant everything is fine, but when run with JS fant runner exception is thrown.

I can not figureout what I am doing wrong.

Thanks for help

Ivos

@Js
class ConstFuncTest : Test
{
  Void test1()
  {
      echo("***\t" + FuncAtStaticConstSlot.f1("fuu").toStr)
      echo("***\t" + StaticFunc.f2("bar").toStr)
  }
}

@Js
class FuncAtStaticConstSlot
{
  static const |Str->Bool| f1 := |Str tag->Bool| { echo("FuncAtStaticConstSlot.f($tag)"); return true }
}

@Js
class StaticFunc
{
  static const |Str->Bool| f2 := StaticFunc#.method("f").func.toImmutable

  static Bool f(Str tag)
  {
      echo("StaticFunc.f($tag)")
      return true
  }
}

andy Mon 11 Feb 2013

See #1144

bedla Mon 11 Feb 2013

Ok, thanks. :)

Login or Signup to reply.