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

Allow calling coroutines in constructors #26

Open
prolativ opened this issue Jun 30, 2021 · 0 comments
Open

Allow calling coroutines in constructors #26

prolativ opened this issue Jun 30, 2021 · 0 comments

Comments

@prolativ
Copy link
Contributor

E.g.

class Foo(i: Int)(using FailingWith[String]#C) {
  val j = if i >= 0 then i else fail("Cannot be negative")
}

This won't work unless we allow suspending in non-inline methods or we could define inline constructors scala/scala3#12986

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

No branches or pull requests

1 participant