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

Make compiletime.error more useful #6622

Closed
odersky opened this issue Jun 6, 2019 · 0 comments
Closed

Make compiletime.error more useful #6622

odersky opened this issue Jun 6, 2019 · 0 comments

Comments

@odersky
Copy link
Contributor

odersky commented Jun 6, 2019

Right now error is defined like this:

inline def error(inline msg: String, objs: Any*): Nothing

We should make it take a full interpolated string. That does not work now, since interpolated
strings are not inline constants.

rtfpessoa added a commit to rtfpessoa/dotty that referenced this issue Jun 11, 2019
Allows to get string representations for code passed in $args

```scala
inline def logged(p1: => Any) = {
  val c = code"code: $p1"
  val res = p1
  (c, p1)
}
logged(indentity("foo"))
```

`logged...` is equivalent to:
```scala
("code: indentity("foo")", indentity("foo"))
```
rtfpessoa added a commit to rtfpessoa/dotty that referenced this issue Jun 11, 2019
Allows to get string representations for code passed in the interpolated
values

```scala
inline def logged(p1: => Any) = {
  val c = code"code: $p1"
  val res = p1
  (c, p1)
}
logged(indentity("foo"))
```

is equivalent to:
```scala
("code: indentity("foo")", indentity("foo"))
```
rtfpessoa added a commit to rtfpessoa/dotty that referenced this issue Jun 11, 2019
Allows to get string representations for code passed in the interpolated
values

```scala
inline def logged(p1: => Any) = {
  val c = code"code: $p1"
  val res = p1
  (c, p1)
}
logged(indentity("foo"))
```

is equivalent to:
```scala
("code: indentity("foo")", indentity("foo"))
```
nicolasstucki added a commit that referenced this issue Jun 14, 2019
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