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
Copy file name to clipboardExpand all lines: const_checks.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,10 @@ Dynamic checks are conceptually very simple: when evaluating the compile-time co
9
9
Thus, a dynamic check generally makes it very clear what is being protected against.
10
10
11
11
The main disadvantage of dynamic checks is that they can only run when the compile-time code is being evaluated, which is after monomorphization.
12
-
We generally try to avoid post-monomorphization errors as they make for a bad user experience.
12
+
We generally try to avoid post-monomorphization errors as they inherently make for a bad user experience.
13
+
While there are technical aspects that could be improved here, the main problem is that the site where the error is reported is disconnected from the site where the root cause is.
14
+
Such problems can be observed when creating an associated constant that uses associated constants from generic parameters.
15
+
These generic parameters are unknown, so the usage of these associated constants may cause errors depending on the *value* of the generic parameter's associated constants.
13
16
14
17
[Promotion analysis](promotion.md) also makes little sense dynamically as it is about code transformation.
15
18
All we can do is check after the transformation if the generated code makes sense.
0 commit comments