File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,26 @@ passing the flag `-Xfrontend -debug-constraints`:
219219 $ swift repl -Xfrontend -debug-constraints
220220 1> let foo = 1
221221
222+ ### Debugging Evaluator Cycles
223+
224+ When triggering code in the type checker, one can by mistake cause a cycle in
225+ the request evaluator. The error looks as follows:
226+
227+ ```
228+ <unknown>:0: error: circular reference
229+ file.swift:18:22: note: through reference here
230+ 16 |
231+ 17 | extension MyType {
232+ 18 | public static func test() -> MyType { ... }
233+ | `- note: through reference here
234+ 19 | }
235+ 20 |
236+ ```
237+
238+ To determine the actual circular request that is occuring, one can pass in the
239+ flag ` -debug-cycles ` to the compiler which will cause the compiler to dump out
240+ the linear chain of requests that led to the cycle.
241+
222242## Debugging on SIL Level
223243
224244### Options for Dumping the SIL
You can’t perform that action at this time.
0 commit comments