Top level function names restricted?

35 views Asked by At

Normally Ceylon loves when a file name corresponds with the name of the (only) class that gets declared in that file.

When I try to follow the same pattern with a top level function, the IDE barks at me. Example:

File structure:

  • utils/
    • file/
      • package.json
      • stringFromFile.ceylon
    • module.ceylon
    • package.ceylon

The content of the file stringFromFile.ceylon:

String|Null stringFromFile() {
    return null
}

The error message produced by the IDE is: "duplicate declaration. The name stringFromFile is not unique in this scope". This message occurs when the cursor hovers over the function name declaration of 'stringFromFile'.

This declaration of stringFromFile is the only one in the code base (as revealed by a global search). The only "overlapping" name is the name of the containing file. Why are these two names not allowed to overlap?

1

There are 1 answers

1
AudioBubble On BEST ANSWER

Restarting the IntelliJ IDE will solve the problem.