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
AST: Improve robustness with invalid nesting of extensions in generic context
Extensions cannot capture generic parameters from outer contexts.
Their generic parameter list does not point to the outer
parameter list, the signature does not contain outer parameters
and they do not appear in the extension's generic environment.
Furthermore, the depth/index of the extension's parameters may
clash with outer parameters, which would break all kinds of
invariants.
This patch changes these DeclContext methods to return false or
nullptr even if an extension is contained in a generic context:
- isGenericContext()
- getGenericParamsOfContext()
- getGenericSignatureOfContext()
- getGenericEnvironmentOfContext()
Copy file name to clipboardExpand all lines: validation-test/compiler_crashers_fixed/28445-gp-getouterparameters-proto-getdeclcontext-getgenericparamsofcontext-failed.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
// See https://swift.org/LICENSE.txt for license information
6
6
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
7
7
8
-
// RUN: not --crash %target-swift-frontend %s -emit-ir
0 commit comments