Files
swift-mirror/test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.explicit.response
Chris Lattner 7daaa22d93 Completely reimplement/redesign the AST representation of parameters.
Parameters (to methods, initializers, accessors, subscripts, etc) have always been represented
as Pattern's (of a particular sort), stemming from an early design direction that was abandoned.
Being built on top of patterns leads to patterns being overly complicated (e.g. tuple patterns
have to have varargs and default parameters) and make working on parameter lists complicated
and error prone.  This might have been ok in 2015, but there is no way we can live like this in
2016.

Instead of using Patterns, carve out a new ParameterList and Parameter type to represent all the
parameter specific stuff.  This simplifies many things and allows a lot of simplifications.
Unfortunately, I wasn't able to do this very incrementally, so this is a huge patch.  The good
news is that it erases a ton of code, and the technical debt that went with it.  Ignoring test
suite changes, we have:
   77 files changed, 2359 insertions(+), 3221 deletions(-)

This patch also makes a bunch of wierd things dead, but I'll sweep those out in follow-on
patches.

Fixes <rdar://problem/22846558> No code completions in Foo( when Foo has error type
Fixes <rdar://problem/24026538> Slight regression in generated header, which I filed to go with 3a23d75.

Fixes an overloading bug involving default arguments and curried functions (see the diff to
Constraints/diagnostics.swift, which we now correctly accept).

Fixes cases where problems with parameters would get emitted multiple times, e.g. in the
test/Parse/subscripting.swift testcase.

The source range for ParamDecl now includes its type, which permutes some of the IDE / SourceModel tests
(for the better, I think).

Eliminates the bogus "type annotation missing in pattern" error message when a type isn't
specified for a parameter (see test/decl/func/functions.swift).

This now consistently parenthesizes argument lists in function types, which leads to many diffs in the
SILGen tests among others.

This does break the "sibling indentation" test in SourceKit/CodeFormat/indent-sibling.swift, and
I haven't been able to figure it out.  Given that this is experimental functionality anyway,
I'm just XFAILing the test for now.  i'll look at it separately from this mongo diff.
2015-12-31 19:24:46 -08:00

72 lines
1.4 KiB
Plaintext

public func fooHelperExplicitFrameworkFunc1(a: Int32) -> Int32
[
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 1,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 8,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 13,
key.length: 31
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 45,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 48,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 58,
key.length: 5
}
]
[
{
key.kind: source.lang.swift.ref.struct,
key.offset: 48,
key.length: 5,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 58,
key.length: 5,
key.is_system: 1
}
]
[
{
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fooHelperExplicitFrameworkFunc1(_:)",
key.offset: 8,
key.length: 55,
key.nameoffset: 13,
key.namelength: 41,
key.substructure: [
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "a",
key.offset: 45,
key.length: 8,
key.typename: "Int32",
key.nameoffset: 0,
key.namelength: 0
}
]
}
]