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

Effect mismatch error on method invocation: show the latent effect of the function #7

Open
lrytz opened this issue May 10, 2013 · 0 comments

Comments

@lrytz
Copy link
Owner

lrytz commented May 10, 2013

When a (non-polymorphic, for this case see #6) method invocation triggers an effect mismatch error, it would be helpful to simply display the latent effect of the invoked method.

This example fails because println() does not have effect annotations:

  def foo: Unit @mod() = {
    println()
  }

The error message requires some time to understand:

T.scala:42: error: effect type mismatch;
 found   : @mod(any) @assign(any) @loc(any) @throws[Throwable] @io
 required: @mod() @loc(any) @throws[Throwable] @io
@mod(any) does not conform to @mod()
@assign(any) does not conform to @assign()
    println()
           ^
four errors found
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

1 participant