Skip to content

Changes to Scala syntax for better effect syntax #9

Description

@lrytz

Three syntax changes we'd like to push to Scala:

  • Allow return type (and therefore effect) on constructors
class C(x: Int): C @pure extends D {
}
  • Same thing for auxiliary constructors
class C extends D {
  def this(x: Int): C @pure = { ... }
}
  • Allow result type annotations without result type (meaning: infer type, but check effect)
def foo(x: Int): @pure = x + 1

The first two will eliminate the special cases for constructor effect annotations.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions