#992 Fansh - Coerce to non-null error

tactics Tue 23 Feb 2010

It's self explanatory. Looks like variables local to the evaluator are inferring Obj instead of Obj?

C:\Documents and Settings\Michael\Desktop>fansh
Fantom Shell v1.0.51 ('?' for help)
fansh> x := null
null
fansh> x
sys::NullErr: Coerce to non-null
  fan.sys.NullErr.makeCoerce (NullErr.java:38)
  fansh::Evaluator.eval (Evaluator.fan:53)
  fan.sys.Func$Indirect1.call (Func.java:133)
  fan.sys.Map.each (Map.java:341)
  fansh::Evaluator.eval (Evaluator.fan:49)
  fansh::Shell.run (Shell.fan:45)
  fansh::Main.main (Shell.fan:201)
  java.lang.reflect.Method.invoke (Unknown)
  fan.sys.Method.invoke (Method.java:536)
  fan.sys.Method$MethodFunc.callList (Method.java:182)
  fan.sys.Method.callList (Method.java:147)
  fanx.tools.Fan.callMain (Fan.java:135)
  fanx.tools.Fan.executeType (Fan.java:102)
  fanx.tools.Fan.execute (Fan.java:38)
  fanx.tools.Fan.run (Fan.java:235)
  fanx.tools.Fan.main (Fan.java:273)

tactics Wed 24 Feb 2010

Sure I'll throw another one on the issue stack. The second error is being thrown due to the first. Only the first should be shown to the user.

fansh> Str[,] == Int[,]
ERROR(1): Incomparable types 'sys::Str[]' and 'sys::Int[]'
ERROR(1): Not a statement
fansh> 

brian Wed 24 Feb 2010

Fixed the null coerce bug.

I agree second issue is a bug, but that isn't something I will likely fix - it is more an artifact of how I am using the compiler to evaluate expressions when the compiler only knows how to parse classes.

Login or Signup to reply.