IDE compilation error

28 views
Skip to first unread message

omid pourhadi

unread,
Jul 16, 2016, 7:23:06 AM7/16/16
to ceylon-users
Hi,

I'm using ceylon 1.2.2, Oracle JDK 1.8.0_77, eclipse luna (Ceylon IDE 1.2.1).
I try to run following code :

hello.ceylon

shared void hello() {print("Hello World");}

hello()

it runs successfully but IDE complains as below :

- incorrect syntax: no viable alternative at token end of file
- missing declaration or argument name

Dirk Lattermann

unread,
Jul 16, 2016, 7:44:55 AM7/16/16
to ceylon...@googlegroups.com
The hello() is not needed in the ceylon file.

When you tell the IDE or the ceylon command to run a Ceylon program, you
need to give the start function that the runtime calls as entry point.
In your case, this is shared void hello().

You seem to think that Ceylon runs the hello.ceylon file by reading the
function definition and then call the defined function (hence your
"hello()" in the source file). This is not the case.

HTH, Dirk.

Am Sat, 16 Jul 2016 04:23:06 -0700 (PDT)
schrieb omid pourhadi <omidpo...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages