Got a bug to report. I haven't narrowed down a small case, but it's also not too large. I have one fathom file, Matrix.fan:
using [java] fanx.interop::DoubleArray as FloatArray
class Matrix {
private FloatArray imag
private Int m
private Int n
private FloatArray real
new make(Num[][] rows := Float[][,]) {
m = rows.size
n = 0
//rows.each |Num[] row| {
// TODO Check for complex.
// n = n.max(row.size)
//}
echo(m)
real = FloatArray(m * n)
echo(real.size)
}
}
And one test file:
class MatrixTest: Test {
Void testAdd() {
matrix := Matrix([
[1, 2],
[3, 4]
])
}
}
tompalmer Wed 31 Dec 2008
Got a bug to report. I haven't narrowed down a small case, but it's also not too large. I have one fathom file, Matrix.fan:
using [java] fanx.interop::DoubleArray as FloatArray class Matrix { private FloatArray imag private Int m private Int n private FloatArray real new make(Num[][] rows := Float[][,]) { m = rows.size n = 0 //rows.each |Num[] row| { // TODO Check for complex. // n = n.max(row.size) //} echo(m) real = FloatArray(m * n) echo(real.size) } }And one test file:
class MatrixTest: Test { Void testAdd() { matrix := Matrix([ [1, 2], [3, 4] ]) } }And I get this error:
compile [fathom] Compile [fathom] FindSourceFiles [2 files] WritePod [/home/tom/Applications/fan-1.0.36/lib/fan/fathom.pod] BUILD SUCCESS [2035ms]! -- Run: fathom::MatrixTest.testAdd... TEST FAILED sys::Err: java.lang.VerifyError: (class: fan/fathom/Matrix, method: make$ signature: (Lfan/fathom/Matrix;)V) Stack size too large fathom::MatrixTest.testAdd (MatrixTest.fan:5) sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java) sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke (Method.java:597) fan.sys.Method.invoke (Method.java:558) fan.sys.Method$MethodFunc.call (Method.java:222) fan.sys.Method.call (Method.java:178) fanx.tools.Fant.runTest (Fant.java:171) ...This is on Fan 1.0.36 on 32-bit Linux and Java 6.
brian Wed 31 Dec 2008
Thanks for your bug report Tom.
It actually comes down to one line in how I was generating the wrappers for parameter defaults:
new make(Num[][] rows := Float[][,]) {}I pushed a fix to hg and added a test for that case.
tompalmer Wed 31 Dec 2008
Thanks for the quick reply.
tompalmer Wed 14 Jan 2009
I've tested that this error is now fixed for me in 1.0.37.