#561 Compiler: Internal error - auto-cast of Func

KevinKelley Thu 30 Apr 2009

This test case

class X
{
  Obj[] list := [,]

  Void each(Func func) { list.each(func) }
}

gives this compiler stack trace:

sys::CastErr: java.lang.ClassCastException: fan.compiler.ReflectType cannot be cast to fan.compiler.FuncType
  compiler::CheckErrors.isFuncAutoCoerce (CheckErrors.fan:1527)
  compiler::CheckErrors.doCoerce (CheckErrors.fan:1509)
  compiler::CheckErrors.coerce (CheckErrors.fan:1464)
  compiler::CheckErrors.checkArgs (CheckErrors.fan:1290)
  fan.sys.List.each (List.java:514)
  compiler::CheckErrors.checkArgs (CheckErrors.fan:1279)
  compiler::CheckErrors.checkCall (CheckErrors.fan:1015)
  compiler::CheckErrors.visitExpr (CheckErrors.fan:689)
  compiler::Expr.walk (Expr.fan:220)
  compiler::Stmt.walkExpr (Stmt.fan:55)
  compiler::ExprStmt.walkChildren (Stmt.fan:107)
  compiler::Stmt.walk (Stmt.fan:42)
  compiler::Block.walk (Block.fan:81)
  fan.sys.List.each (List.java:509)
  compiler::Block.walk (Block.fan:79)
  compiler::MethodDef.walk (MethodDef.fan:160)
  compiler::TypeDef.walk (TypeDef.fan:297)
  fan.sys.List.each (List.java:509)

brian Thu 30 Apr 2009

Renamed from Compiler: Internal error to Compiler: Internal error - auto-cast of Func

brian Thu 30 Apr 2009

Promoted to ticket #561 and assigned to brian

brian Thu 30 Apr 2009

Ticket resolved in 1.0.42

Login or Signup to reply.