mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Since getSpecifier() now kicks off a request instead of always returning what was previously set, we can't pass a ParamSpecifier to the ParamDecl constructor anymore. Instead, callers either call setSpecifier() if the ParamDecl is synthesized, or they rely on the request, which can compute the specifier in three specific cases: - Ordinary parsed parameters get their specifier from the TypeRepr. - The 'self' parameter's specifier is based on the self access kind. - Accessor parameters are either the 'newValue' parameter of a setter, or a cloned subscript parameter. For closure parameters with inferred types, we still end up calling setSpecifier() twice, once to set the initial defalut value and a second time when applying the solution in the case that we inferred an 'inout' specifier. In practice this should not be a big problem because expression type checking walks the AST in a pre-determined order anyway.
18 KiB
18 KiB