Classes in worksheet in Scala -IDE cause error

Simply create an instance of the class by entering the following into the worksheet (note that the worksheet created using the file> New> Scala Worksheet, a .sc file, not a regular .scala file) and clicking the Save button causes a false error:

enter image description here

Mouseover:

enter image description here

"A few tokens on this line are an illegal start to a simple expression - ';' expected, but identifier found. "

I doubt that everything is as simple as it could pass the test, perhaps this is a configuration problem. I tried this on two machines and got the same behavior:

1) Windows 7 with Eclipse Helios

2) Windows XP with Eclipse Indigo - a clean boot from the Cyres website

Any ideas? Do other people get this from their installation?

+4
source share
2 answers

This bug was fixed in the Scala compiler, but the patch is not in the version that ships with the release of the intermediate version.

If you upgrade the nightly build of the Scala IDE, you can use this code template.

+3
source

During the lectures of Martin Oder, Coursera I noticed that he announces his classes outside the main subject in his books.

I hope this helps

 object Worksheet { new Foo } class Foo 
+4
source

Source: https://habr.com/ru/post/1437901/


All Articles