Files
swift-mirror/test/SourceKit/DocumentStructure/Inputs/main.swift
Nathan Hawes 2420b6d28b [SourceKit] Don't report the ObjC runtime name without @objc(Name)
We used to compute the mangled name in other cases, but document structure is
a syntactic request and can't guarantee that the class/protocol we're getting
the mangled name of is valid in any way so it often breaks assumptions in the
mangler and causes it to crash. It's not clear if the runtime_name is actually
being used anymore, so this change restricts reporting it to just the cases
where we don't need to mangle.

rdar://problem/40956377
2020-02-14 11:40:09 -08:00

171 lines
2.6 KiB
Swift
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
class Foo : Bar {
var test : Int
@IBOutlet var testOutlet : Int
func testMethod() {
if test {
}
}
@IBAction func testAction() {
}
}
@IBDesignable
class Foo2 {}
class Foo3 {
@IBInspectable var testIBInspectable : Int
@GKInspectable var testGKInspectable : Int
}
protocol MyProt {}
class OuterCls {
class InnerCls1 {}
}
extension OuterCls {
class InnerCls2 {}
}
class GenCls<T1, T2> {}
class TestParamAndCall {
func testParams(arg1: Int, name: String) {
if (arg1) {
testParams(0, name:"testing")
}
}
func testParamAndArg(arg1: Int, param par: Int) {
}
}
// FIXME: Whatever.
class TestMarkers {
// TODO: Something.
func test(arg1: Bool) -> Int {
// FIXME: Blah.
if (arg1) {
// FIXME: Blah.
return 0
}
return 1
}
}
func test2(arg1: Bool) {
if (arg1) {
// http://whatever FIXME: http://whatever/fixme.
}
}
extension Foo {
func anExtendedFooFunction() {
}
}
// rdar://19539259
var (sd2: Qtys)
{
417(d: nil)
}
for i in 0...5 {}
for var i = 0, i2 = 1; i == 0; ++i {}
while var v = o, var z = o, v > z {}
repeat {} while v == 0
if var v = o, var z = o, v > z {}
switch v {
case 1: break;
case 2, 3: break;
default: break;
}
let myArray = [1, 2, 3]
let myDict = [1:1, 2:2, 3:3]
// rdar://21203366
@objc
class ClassObjcAttr : NSObject {
@objc
func m() {}
}
@objc(Blah)
class ClassObjcAttr2 : NSObject {
@objc(Foo)
func m() {}
}
protocol FooProtocol {
associatedtype Bar
associatedtype Baz: Equatable
}
// SR-5717
a.b(c: d?.e?.f, h: i)
// SR-6926
/* 👨👩👧👦👨👩👧👦👨👩👧👦 */
`init`(x: Int, y: Int) {}
class C {
/* 👨👩👧👦👨👩👧👦👨👩👧👦 */
`init`(x: Int, y: Int) {}
}
var // comment
`$` = 1
func /* comment */`foo`(x: Int) {}
// rdar://40085232
enum MyEnum {
case Bar(arg: Int)
}
enum MySecondEnum {
case One = 1
}
func someFunc(input :Int?, completion: () throws -> Void) rethrows {}
class OneMore {
@IBSegueAction func testAction(coder: AnyObject, _ ident: String) -> AnyObject {
fatalError()
}
}
class Chain<A> {
func + (lhs: Chain<A>, rhs: Chain<A>) -> Chain<A> { fatalError() }
}
public init() {
fatalError()
}
deinit {
fatalError()
}
#if false
extension Result {
func foo() {}
}
extension Outer {
class Inner {
deinit {}
}
}
public extension Outer2 {
class Inner2 {
deinit {}
}
}
#endif
@objc(FPBarProto)
protocol BarProtocol {}