You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fact that a Term can be any tree at all makes the interface unsafe: non-terms may potentially be returned in place of terms when matching on trees. Implementing runtime checks is performance-costly – however we can implement such checks under a separate compiler flag and run them from the CI.
One possible implementation would involve a wrapper around the standard compiler interface:
We started adding assertions within the reflection API directly behind the YCheck flags. This has the advantage of catching errors early. Other checks should be done in normal Ycheck.
Uh oh!
There was an error while loading. Please reload this page.
The
CompilerInterface
implementation has itsTerm
defined to be aTree
:https://github.com/lampepfl/dotty/blob/b5f2f1831a17efc0bef80742a9b992134dc7061b/compiler/src/dotty/tools/dotc/tastyreflect/ReflectionCompilerInterface.scala#L226
The fact that a
Term
can be any tree at all makes the interface unsafe: non-terms may potentially be returned in place of terms when matching on trees. Implementing runtime checks is performance-costly – however we can implement such checks under a separate compiler flag and run them from the CI.One possible implementation would involve a wrapper around the standard compiler interface:
The
verifyStatement
method above should do the following:Statement
Some
See #7503 for an example (test case) of where things go wrong without such checks.
The text was updated successfully, but these errors were encountered: