Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method effect annotations may differ between type and module #347

Open
Darya- opened this issue Aug 22, 2019 · 1 comment
Open

Method effect annotations may differ between type and module #347

Darya- opened this issue Aug 22, 2019 · 1 comment

Comments

@Darya-
Copy link
Member

Darya- commented Aug 22, 2019

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.

@JonathanAldrich
Copy link
Member

It's not surprising that no error would be given because logger.wyv does not have effect annotations. Putting an annotation {} on the module definition should force an annotation on updateLog. According to my conversation with @Darya- this is not the case, so that is the first thing we should fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants