Skip to content

Commit 8b2d270

Browse files
committed
DiagnoseInfiniteRecursion: re-implement the pass in swift and fix a bug
Fixes a false alarm in case of recursive calls with different type parameters. For example: ``` protocol P { associatedtype E: P } func noRecursionMismatchingTypeArgs1<T: P>(_ t: T.Type) { if T.self == Int.self { return } noRecursionMismatchingTypeArgs1(T.E.self) } ```
1 parent ac55dae commit 8b2d270

File tree

7 files changed

+622
-603
lines changed

7 files changed

+622
-603
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ swift_compiler_sources(Optimizer
1818
DeadStoreElimination.swift
1919
DeinitDevirtualizer.swift
2020
DestroyHoisting.swift
21+
DiagnoseInfiniteRecursion.swift
2122
InitializeStaticGlobals.swift
2223
LetPropertyLowering.swift
2324
LifetimeDependenceDiagnostics.swift

0 commit comments

Comments
 (0)