Skip to content

Exported nullary methods from java-defined classes require parentheses #17589

Open
@prolativ

Description

@prolativ

Compiler version

3.3.1-RC1-bin-20230524-5262680-NIGHTLY and before

Minimized code

class StringBox(inner: String):
  export inner.length

val l = StringBox("abc").length

Output

[error] Export.scala:4:9
[error] method length in class StringBox must be called with () argument
[error] val l = StringBox("abc").length
[error]         ^^^^^^^^^^^^^^^^^^^^^^^

Expectation

This should compile. In general, it should be possible to call nullary methods exported from java-defined classes without parentheses.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions