"Unexpected error" with simplest possible ash use

tricus

New member
Hi,

I must be doing something wrong, and I hope someone can point out my error.

Step 1: Create functions.ash containing:

Code:
void foo()
{
    print("foo!");
}

Step 2: In KoLmafia CLI, attempt to use the new function more than once:
Code:
> verify functions.ash

void foo( )

Script verification complete.

> using functions.ash

void foo()

Script verification complete.

> foo

foo!

> foo

[B]Unexpected error, debug log printed.[/B]

> foo

[B]Unexpected error, debug log printed.[/B]


Anybody have an idea of what is happening here?

Here is the stack trace:

Unexpected error, debug log printed.
class java.lang.ClassCastException: java.lang.Long cannot be cast to java.io.File
java.lang.ClassCastException: java.lang.Long cannot be cast to java.io.File
at net.sourceforge.kolmafia.textui.NamespaceInterpreter.execute(NamespaceInterpreter.java:83)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeScriptCommand(KoLmafiaCLI.java:4539)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeScript(KoLmafiaCLI.java:4482)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:564)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:450)
at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:317)
at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:298)


This started happening to me way back in v12.6 and on every unofficial build I have tried since. It didn't happen on v12.5. Today I tried it on a new PC that never had KoLmafia on it and the result is the same. Am I missing something obvious here?

Running Windows XP Pro SP3, Java 6 update 12
 
Last edited:

tricus

New member
So I guess it's just me then?

[Sorry to double post...]

Am I just cursed? I'm not doing anything bizarre, am I? Is this some kind of weird JVM problem? Is anyone out there??? :p
 

Veracity

Developer
Staff member
I saw this, decided to look into it by and by, and forgot about it. Sorry.

You are "using" a file - which is NOT the "simplest possible use" of ASH. Apparently, you are the only one to try it, since it was busted, as you observe.

Fixed in revision 7118.
 

tricus

New member
Muchas gracias!

I saw this, decided to look into it by and by, and forgot about it. Sorry.

You are "using" a file - which is NOT the "simplest possible use" of ASH. Apparently, you are the only one to try it, since it was busted, as you observe.

Fixed in revision 7118.

Thank you thank you thank you thank you!!! So happy! :D

Forgive my obtuseness (obtusity?) but I thought the point of user-created functions was to run them in the CLI? (I mean, other than running scripts wholesale from the scripts menu). Does nobody do this? Ok, I guess that's kind of rhetorical since nobody else noticed or cared that this wasn't working...

Thanks a million billions for fixing this, super V!
 
Top