Skip to content

Commit e1510e3

Browse files
authored
Fix warning about -Xcheck-macros (#25757)
Discussing with @bishabosha and further investigating, I realized the warning I introduced yesterday in #25750 is wrong. Code generated by macros is actually checked, even without `-Xcheck-macros`, here: https://github.com/scala/scala3/blob/20fc4c757617742af469c925d48beaf888f7ebfe/compiler/src/dotty/tools/dotc/inlines/Inliner.scala#L966-L967 The errors I am missing are due to these checks being run without an expected type, which I'll try to address separately (#25756). This PR reverts #25750, but still rephrase to avoid saying these are _runtime_ checks.
2 parents ffb1a63 + 9d2433e commit e1510e3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/_docs/reference/metaprogramming/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "Macros"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/metaprogramming/macros.html
55
---
66

7-
> **Warning:** Always enable `-Xcheck-macros` when developing macros. Without it, the compiler will not validate generated code, which may be unsound and lead to undefined behavior.
7+
> When developing macros, enable the `-Xcheck-macros` compiler option to run extra safety checks.
88
99
## Multi-Staging
1010

docs/_spec/TODOreference/metaprogramming/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "Macros"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/metaprogramming/macros.html
55
---
66

7-
> **Warning:** Always enable `-Xcheck-macros` when developing macros. Without it, the compiler will not validate generated code, which may be unsound and lead to undefined behavior.
7+
> When developing macros, enable the `-Xcheck-macros` compiler option to run extra safety checks.
88
99
## Multi-Staging
1010

0 commit comments

Comments
 (0)