Skip to content

Warnings in macros are issued with c.warning, not c.info #842

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

Merged
merged 1 commit into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _ja/overviews/macros/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Scala コードの生成については[リフレクションの概要](http://d
### 警告とエラーの報告

ユーザと対話するための正式な方法は `scala.reflect.macros.FrontEnds` のメソッドを使うことだ。
`c.error` はコンパイルエラーを報告し、`c.info` は警告を発令し、`c.abort` はエラーを報告しマクロの実行を停止する。
`c.error` はコンパイルエラーを報告し、`c.warning` は警告を発令し、`c.abort` はエラーを報告しマクロの実行を停止する。

scala> def impl(c: Context) =
c.abort(c.enclosingPosition, "macro has reported an error")
Expand Down
2 changes: 1 addition & 1 deletion _overviews/macros/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ As the printout shows, nothing dramatic happens. Compiler guards itself against
### Reporting warnings and errors

The canonical way to interact with the user is through the methods of `scala.reflect.macros.FrontEnds`.
`c.error` reports a compilation error, `c.info` issues a warning, `c.abort` reports an error and terminates
`c.error` reports a compilation error, `c.warning` issues a warning, `c.abort` reports an error and terminates
execution of a macro.

scala> def impl(c: Context) =
Expand Down