Skip to content

Method effect annotations may differ between type and module #347

@Darya-

Description

@Darya-

In the text-editor application, annotate the logger type and module in the following way:

logger.wyv:

module def logger(logFile: fileSystem.File): Logger
effect Update = {system.FFI}
def updateLog(msg: String): Unit
  val logAppender = logFile.makeAppender()
  logAppender.write(msg)
  logAppender.close()

Logger.wyt:

resource type Logger
  effect Update
  def updateLog(msg: String): {this.Update} Unit

Run the text-editor application.

Expected behavior: Throws an error saying that the logger module doesn't match the Logger type because logger's method isn't annotated with the matching effect (i.e., logger's method should have the signature: def updateLog(msg: String): {Update} Unit).

Actual behavior: No error is thrown.

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