Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[golo-dev] Compiler hangs when assigning value to uninitialized variable in if block

Title: Compiler hangs when assigning value to uninitialized variable in if block

         Hello,


I've been fascinated by Golo ever since reading about it in Oracle Java Magazine some time ago. I've played around with it for awhile and tweeted multiple times about the language to do some little promotion.

Now the time's come to try to write my first "real" application in Golo, I'm creating a simple Spark-java webservice powered by Golo and both having fun and learning a lot while doing this.

 

As I'm still learning the language, I make some silly noob mistakes.

 

I think I managed to crash the compiler (assuming it is not Kaspersky virus scanner yet again that causes problems...). This snippet reproduces the problem:

 

module bla

function main = |args| { var test if args:size() > 0 { test = 1 } else { test = 2 }

}

 

The "golo compile test.golo" command hangs on my Windows 10 desktop computer, running Golo 3.2.0-M4  i.e. it seems to be stuck in an infinite loop.

 

It's obvious that I should have RTFM and assigned a value to "test" when declaring it, which indeed solves the crash, but I assume the compiler should not hang when I forget to do that, right?

 

Best regards and keep up the good work,

Vincent

 


Back to the top