diff --git a/lib/IDE/CodeCompletionResultBuilder.h b/lib/IDE/CodeCompletionResultBuilder.h index 9ebd51714c8..8c0a1cb698f 100644 --- a/lib/IDE/CodeCompletionResultBuilder.h +++ b/lib/IDE/CodeCompletionResultBuilder.h @@ -175,12 +175,6 @@ public: getLastChunk().setIsAnnotation(); } - // Print non-inout '@unchecked' optional arguments as normal optionals, - // because the difference is not important for the caller. - if (Type ObjectType = Ty->getImplicitlyUnwrappedOptionalObjectType()) { - Ty = OptionalType::get(ObjectType); - } - // 'inout' arguments are printed specially. if (auto *IOT = Ty->getAs()) { addChunkWithTextNoCopy( diff --git a/test/IDE/complete_dynamic_lookup.swift b/test/IDE/complete_dynamic_lookup.swift index 5ea5f097082..63e5b82a9e8 100644 --- a/test/IDE/complete_dynamic_lookup.swift +++ b/test/IDE/complete_dynamic_lookup.swift @@ -107,7 +107,7 @@ protocol Bar { func bar() } // DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule: .nested2_ObjcInstanceFunc1!()[#Void#]{{$}} // DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule: .nested2_Property[#Int?#]{{$}} // DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule: .objectAtIndexedSubscript!({#(idx): Int32#})[#AnyObject!#]{{$}} -// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule: .objectForKeyedSubscript!({#(key): AnyObject?#})[#AnyObject!#]{{$}} +// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule: .objectForKeyedSubscript!({#(key): AnyObject!#})[#AnyObject!#]{{$}} // DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule: .returnsObjcClass!({#(i): Int#})[#TopLevelObjcClass#]{{$}} // DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule: .topLevelClass_ObjcInstanceFunc1!()[#Void#]{{$}} // DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule: .topLevelClass_ObjcProperty1[#Int?#]{{$}} @@ -124,7 +124,7 @@ protocol Bar { func bar() } // DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule: [{#i: TopLevelObjcClass#}][#Int?#]{{$}} // DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule: [{#i: TopLevelObjcProtocol#}][#Int?#]{{$}} // DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule: [{#idx: Int32#}][#AnyObject!?#]{{$}} -// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule: [{#key: AnyObject?#}][#AnyObject!?#]{{$}} +// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule: [{#key: AnyObject!#}][#AnyObject!?#]{{$}} // DL_INSTANCE_NO_DOT: End completions // DL_INSTANCE_DOT: Begin completions @@ -154,7 +154,7 @@ protocol Bar { func bar() } // DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule: nested2_ObjcInstanceFunc1!()[#Void#]{{$}} // DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule: nested2_Property[#Int?#]{{$}} // DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule: objectAtIndexedSubscript!({#(idx): Int32#})[#AnyObject!#]{{$}} -// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule: objectForKeyedSubscript!({#(key): AnyObject?#})[#AnyObject!#]{{$}} +// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule: objectForKeyedSubscript!({#(key): AnyObject!#})[#AnyObject!#]{{$}} // DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule: returnsObjcClass!({#(i): Int#})[#TopLevelObjcClass#]{{$}} // DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule: topLevelClass_ObjcInstanceFunc1!()[#Void#]{{$}} // DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule: topLevelClass_ObjcProperty1[#Int?#]{{$}} diff --git a/test/IDE/complete_from_clang_framework.swift b/test/IDE/complete_from_clang_framework.swift index 9929e0db5bd..8af70dd0473 100644 --- a/test/IDE/complete_from_clang_framework.swift +++ b/test/IDE/complete_from_clang_framework.swift @@ -71,7 +71,7 @@ func testSwiftCompletions(foo: SwiftStruct) { // CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFunc1({#(a): Int32#})[#Int32#]{{$}} // CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFunc1AnonymousParam({#Int32#})[#Int32#]{{$}} // CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFunc3({#(a): Int32#}, {#(b): Float#}, {#(c): Double#}, {#(d): UnsafePointer#})[#Int32#]{{$}} -// CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFuncWithBlock({#(blk): ((Float) -> Int32)?##(Float) -> Int32#})[#Void#]{{$}} +// CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFuncWithBlock({#(blk): ((Float) -> Int32)!#})[#Void#]{{$}} // CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFuncWithComment1()[#Void#]{{$}} // CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFuncWithComment2()[#Void#]{{$}} // CLANG_FOO-DAG: Decl[FreeFunction]/OtherModule: fooFuncWithComment3()[#Void#]{{$}} @@ -159,7 +159,7 @@ func testCompleteModuleQualifiedFoo2() { // CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFunc3({#(a): Int32#}, {#(b): Float#}, {#(c): Double#}, {#(d): UnsafePointer#})[#Int32#]{{$}} // CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFuncNoreturn1()[#Void#]{{$}} // CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFuncNoreturn2()[#Void#]{{$}} -// CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFuncWithBlock({#(blk): ((Float) -> Int32)?##(Float) -> Int32#})[#Void#]{{$}} +// CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFuncWithBlock({#(blk): ((Float) -> Int32)!#})[#Void#]{{$}} // CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFuncWithFunctionPointer({#(fptr): CFunctionPointer<((Float) -> Int32)>#})[#Void#]{{$}} // CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFuncWithComment1()[#Void#]{{$}} // CLANG_QUAL_FOO_2-DAG: Decl[FreeFunction]/OtherModule: .fooFuncWithComment2()[#Void#]{{$}} @@ -243,7 +243,7 @@ func testCompleteClassMembers1() { // CLANG_CLASS_MEMBERS_1: Begin completions // CLANG_CLASS_MEMBERS_1-NEXT: Decl[StaticMethod]/CurrNominal: .fooBaseInstanceFunc0()[#Void#]{{$}} // CLANG_CLASS_MEMBERS_1-NEXT: Decl[InstanceMethod]/CurrNominal: .fooBaseInstanceFunc0({#self: FooClassBase#})[#() -> Void#]{{$}} -// CLANG_CLASS_MEMBERS_1-NEXT: Decl[StaticMethod]/CurrNominal: .fooBaseInstanceFunc1({#(anObject): AnyObject?#})[#FooClassBase!#]{{$}} +// CLANG_CLASS_MEMBERS_1-NEXT: Decl[StaticMethod]/CurrNominal: .fooBaseInstanceFunc1({#(anObject): AnyObject!#})[#FooClassBase!#]{{$}} // CLANG_CLASS_MEMBERS_1-NEXT: Decl[InstanceMethod]/CurrNominal: .fooBaseInstanceFunc1({#self: FooClassBase#})[#(AnyObject!) -> FooClassBase!#]{{$}} // CLANG_CLASS_MEMBERS_1-NEXT: Decl[Constructor]/CurrNominal: ()[#FooClassBase#] // CLANG_CLASS_MEMBERS_1-NEXT: Decl[Constructor]/CurrNominal: ({#withFloat: Float#})[#FooClassBase#]{{$}} @@ -278,7 +278,7 @@ func testCompleteClassMembers2() { // CLANG_CLASS_MEMBERS_2-NEXT: Decl[StaticMethod]/CurrNominal: .fooProtoClassFunc()[#Void#]{{$}} // CLANG_CLASS_MEMBERS_2-NEXT: Decl[StaticMethod]/Super: .fooBaseInstanceFunc0()[#Void#]{{$}} // CLANG_CLASS_MEMBERS_2-NEXT: Decl[InstanceMethod]/Super: .fooBaseInstanceFunc0({#self: FooClassBase#})[#() -> Void#]{{$}} -// CLANG_CLASS_MEMBERS_2-NEXT: Decl[StaticMethod]/Super: .fooBaseInstanceFunc1({#(anObject): AnyObject?#})[#FooClassBase!#]{{$}} +// CLANG_CLASS_MEMBERS_2-NEXT: Decl[StaticMethod]/Super: .fooBaseInstanceFunc1({#(anObject): AnyObject!#})[#FooClassBase!#]{{$}} // CLANG_CLASS_MEMBERS_2-NEXT: Decl[InstanceMethod]/Super: .fooBaseInstanceFunc1({#self: FooClassBase#})[#(AnyObject!) -> FooClassBase!#]{{$}} // CLANG_CLASS_MEMBERS_2-NEXT: Decl[StaticMethod]/Super: .fooBaseInstanceFuncOverridden()[#Void#]{{$}} // CLANG_CLASS_MEMBERS_2-NEXT: Decl[StaticMethod]/Super: .fooBaseClassFunc0()[#Void#]{{$}} @@ -307,7 +307,7 @@ func testCompleteInstanceMembers1(fooObject: FooClassDerived) { // CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/CurrNominal: .fooProtoFuncWithExtraIndentation1()[#Void#]{{$}} // CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/CurrNominal: .fooProtoFuncWithExtraIndentation2()[#Void#]{{$}} // CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/Super: .fooBaseInstanceFunc0()[#Void#]{{$}} -// CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/Super: .fooBaseInstanceFunc1({#(anObject): AnyObject?#})[#FooClassBase!#]{{$}} +// CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/Super: .fooBaseInstanceFunc1({#(anObject): AnyObject!#})[#FooClassBase!#]{{$}} // CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/Super: ._internalMeth3()[#AnyObject!#] // CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/Super: ._internalMeth2()[#AnyObject!#] // CLANG_INSTANCE_MEMBERS_1-NEXT: Decl[InstanceMethod]/Super: .nonInternalMeth()[#AnyObject!#] diff --git a/test/IDE/complete_from_cocoa.swift b/test/IDE/complete_from_cocoa.swift index f24f3a17a71..abe0f95885d 100644 --- a/test/IDE/complete_from_cocoa.swift +++ b/test/IDE/complete_from_cocoa.swift @@ -16,8 +16,8 @@ import Cocoa func testUnqualified() { #^T1^# // T1: Begin completions -// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayCreate({#(allocator): CFAllocator?#}, {#(values): UnsafePointer>#}, {#(numValues): CFIndex#}, {#(callBacks): ConstUnsafePointer#})[#CFArray!#]{{$}} -// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayGetCount({#(theArray): CFArray?#})[#CFIndex#]{{$}} +// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayCreate({#(allocator): CFAllocator!#}, {#(values): UnsafePointer>#}, {#(numValues): CFIndex#}, {#(callBacks): ConstUnsafePointer#})[#CFArray!#]{{$}} +// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayGetCount({#(theArray): CFArray!#})[#CFIndex#]{{$}} // T1-DAG: Decl[Class]/OtherModule: NSObject[#NSObject#]{{$}} // T1: End completions } diff --git a/test/IDE/complete_from_cocoa_2.swift b/test/IDE/complete_from_cocoa_2.swift index 0742dee572a..9c4ae1c2ee0 100644 --- a/test/IDE/complete_from_cocoa_2.swift +++ b/test/IDE/complete_from_cocoa_2.swift @@ -17,8 +17,8 @@ import Cocoa func testQualifiedWithDot() { Cocoa.#^T1^# // T1: Begin completions -// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayCreate({#(allocator): CFAllocator?#}, {#(values): UnsafePointer>#}, {#(numValues): CFIndex#}, {#(callBacks): ConstUnsafePointer#})[#CFArray!#]{{$}} -// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayGetCount({#(theArray): CFArray?#})[#CFIndex#]{{$}} +// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayCreate({#(allocator): CFAllocator!#}, {#(values): UnsafePointer>#}, {#(numValues): CFIndex#}, {#(callBacks): ConstUnsafePointer#})[#CFArray!#]{{$}} +// T1-DAG: Decl[FreeFunction]/OtherModule: CFArrayGetCount({#(theArray): CFArray!#})[#CFIndex#]{{$}} // T1-DAG: Decl[Class]/OtherModule: NSObject[#NSObject#]{{$}} // T1: End completions } @@ -26,8 +26,8 @@ func testQualifiedWithDot() { func testQualifiedWithoutDot() { Cocoa#^T2^# // T2: Begin completions -// T2-DAG: Decl[FreeFunction]/OtherModule: .CFArrayCreate({#(allocator): CFAllocator?#}, {#(values): UnsafePointer>#}, {#(numValues): CFIndex#}, {#(callBacks): ConstUnsafePointer#})[#CFArray!#]{{$}} -// T2-DAG: Decl[FreeFunction]/OtherModule: .CFArrayGetCount({#(theArray): CFArray?#})[#CFIndex#]{{$}} +// T2-DAG: Decl[FreeFunction]/OtherModule: .CFArrayCreate({#(allocator): CFAllocator!#}, {#(values): UnsafePointer>#}, {#(numValues): CFIndex#}, {#(callBacks): ConstUnsafePointer#})[#CFArray!#]{{$}} +// T2-DAG: Decl[FreeFunction]/OtherModule: .CFArrayGetCount({#(theArray): CFArray!#})[#CFIndex#]{{$}} // T2-DAG: Decl[Class]/OtherModule: .NSObject[#NSObject#]{{$}} // T2: End completions } diff --git a/test/IDE/complete_repl_from_cocoa.swift b/test/IDE/complete_repl_from_cocoa.swift index 9299171f03a..b488061713a 100644 --- a/test/IDE/complete_repl_from_cocoa.swift +++ b/test/IDE/complete_repl_from_cocoa.swift @@ -8,7 +8,7 @@ // FIXME: iOS has no Cocoa.framework // REQUIRES: OS=macosx -// CHECK: {{^}}CFArrayCreateCopy(allocator: CFAllocator?, theArray: CFArray?) -> CFArray!{{$}} +// CHECK: {{^}}CFArrayCreateCopy(allocator: CFAllocator!, theArray: CFArray!) -> CFArray!{{$}} // CHECK: {{^}}FE_ALL_EXCEPT: Int32{{$}} import Cocoa diff --git a/test/IDE/complete_value_expr.swift b/test/IDE/complete_value_expr.swift index 6921373d099..ab2a5c6199c 100644 --- a/test/IDE/complete_value_expr.swift +++ b/test/IDE/complete_value_expr.swift @@ -264,7 +264,7 @@ var fooObject: FooStruct // FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1({#(a): Int#})[#Void#]{{$}} // FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc2({#(a): Int#}, {#b: &Double#})[#Void#]{{$}} // FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc3({#(a): Int#}, {#(Float, Double)#})[#Void#]{{$}} -// FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc4({#(a): Int?#}, {#b: Int?#}, {#c: &Int?#}, {#d: &Int!#})[#Void#]{{$}} +// FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc4({#(a): Int?#}, {#b: Int!#}, {#c: &Int?#}, {#d: &Int!#})[#Void#]{{$}} // FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc5()[#Int?#]{{$}} // FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc6()[#Int!#]{{$}} // FOO_OBJECT_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc7({#a: Int#})[#Void#]{{$}} @@ -305,7 +305,7 @@ var fooObject: FooStruct // FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc1({#(a): Int#})[#Void#]{{$}} // FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc2({#(a): Int#}, {#b: &Double#})[#Void#]{{$}} // FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc3({#(a): Int#}, {#(Float, Double)#})[#Void#]{{$}} -// FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc4({#(a): Int?#}, {#b: Int?#}, {#c: &Int?#}, {#d: &Int!#})[#Void#]{{$}} +// FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc4({#(a): Int?#}, {#b: Int!#}, {#c: &Int?#}, {#d: &Int!#})[#Void#]{{$}} // FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc5()[#Int?#]{{$}} // FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc6()[#Int!#]{{$}} // FOO_OBJECT_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc7({#a: Int#})[#Void#]{{$}}