#965 Compiler TypeParser doesn't handle Java FFI

KevinKelley Mon 8 Feb 2010

Can't seem to even link the pod... this test:

using compilerJava

class test {
  Void main() {
    echo("among the living")
  }
}

yields this error:

sys::ArgErr: Invalid type signature '|[java]java.lang::Class->sys::Void|'
compiler::TypeParser.err (TypeParser.fan:175)
compiler::TypeParser.consume (TypeParser.fan:167)
compiler::TypeParser.loadBasic (TypeParser.fan:154)
compiler::TypeParser.loadAny (TypeParser.fan:90)
compiler::TypeParser.loadMap (TypeParser.fan:120)
compiler::TypeParser.loadAny (TypeParser.fan:86)
compiler::TypeParser.loadFunc (TypeParser.fan:136)
compiler::TypeParser.loadAny (TypeParser.fan:82)
compiler::TypeParser.loadTop (TypeParser.fan:71)
compiler::TypeParser.resolve (TypeParser.fan:48)
compiler::CNamespace.resolveType (CNamespace.fan:230)
compiler::ReflectNamespace.importType (ReflectNamespace.fan:64)
compiler::ReflectType.make$ (ReflectType.fan:28)
compiler::ReflectType.make (ReflectType.fan)
compiler::ReflectPod.resolveType (ReflectPod.fan:52)
compiler::ReflectPod.types (ReflectPod.fan:34)
fan.sys.List.each (List.java:527)
compiler::ReflectPod.types (ReflectPod.fan:34)
compiler::ResolveImports.resolveImportedTypes (ResolveImports.fan:154)
fan.sys.List.each (List.java:527)
20 More...

brian Mon 8 Feb 2010

Promoted to ticket #965 and assigned to brian

Looks like that problem was in 44 (and how knows how far back it goes).

I'll take a look when I start the script pod URI stuff, probably just a bug in the compiler's version of TypeParser which isn't handling FFI references correctly.

NOTE: Java FFI does work (at least the test suite fully passes)

brian Mon 8 Feb 2010

Renamed from compilerJava broken? to Compiler TypeParser doesn't handle Java FFI

brian Fri 26 Mar 2010

Since this problem cropped again, I took a look if there was a quick fix.

Fundamentally the syntax for FFI pods using [] was an extremely poor choice because it makes really difficult to parse FFI types versus map types.

So we just need to buckle down and define the final syntax for alternate pods as URIs, or whatever we decide. But the existing FFI syntax needs to change.

brian Fri 7 May 2010

Ticket resolved in 1.0.53

I've fixed the compiler's TypeParser to handle FFI using the original [java]package syntax.

Login or Signup to reply.