I wrote a Fantom script that defines a bunch of classes. As I could run the script successfully, I decided to convert this into a proper Fantom project, but one of the classes cannot be compiled and the error message is:
Expected expression, not '|'
The class has this form:
class MyClass
{
const Func myFunc := |Foo foo, Bar bar| {
// do stuff
}
MyType myVar := MyType()
Void main() {
// do more stuff
}
}
I don't understand why the compiler complains when this class is part of a Fantom project, but doesn't if is part of a Fantom script instead. Can anyone shed some light, please?
Thank you