Skip to content

Commit e86d3bd

Browse files
committed
Revert "[ReconstructType] Fix decl lookup when there are multiple constructors"
This reverts commit 65c86b7. I attempted to resolve the merge conflict, but Jordan will need to do a second check.
1 parent 0ac4fdd commit e86d3bd

File tree

5 files changed

+5
-117
lines changed

5 files changed

+5
-117
lines changed

lib/IDE/ReconstructType.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,15 +1058,6 @@ static void VisitNodeConstructor(
10581058
case TypeKind::Function: {
10591059
const AnyFunctionType *identifier_func =
10601060
identifier_type->getAs<AnyFunctionType>();
1061-
1062-
// inits are typed as (Foo.Type) -> (args...) -> Foo, but don't
1063-
// assert that in case we're dealing with broken code.
1064-
if (identifier_func->getInput()->is<AnyMetatypeType>() &&
1065-
identifier_func->getResult()->is<AnyFunctionType>()) {
1066-
identifier_func =
1067-
identifier_func->getResult()->getAs<AnyFunctionType>();
1068-
}
1069-
10701061
const AnyFunctionType *type_func =
10711062
type_result._types.front()->getAs<AnyFunctionType>();
10721063
if (CanType(identifier_func->getResult()

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ set(swift_stdlib_unittest_module_depends
33
SwiftPrivate SwiftPrivatePthreadExtras SwiftPrivateLibcExtras)
44
set(swift_stdlib_unittest_framework_depends)
55
set(swift_stdlib_unittest_private_link_libraries)
6-
set(swift_stdlib_unittest_compile_flags
7-
"-Xfrontend" "-disable-objc-attr-requires-foundation-module")
6+
set(swift_stdlib_unittest_compile_flags)
87

98
if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
109
list(APPEND swift_stdlib_unittest_platform_sources

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -448,30 +448,8 @@ let _crashedPrefix = "CRASHED:"
448448
@_silgen_name("swift_stdlib_installTrapInterceptor")
449449
func _stdlib_installTrapInterceptor()
450450

451-
#if _runtime(_ObjC)
452-
@objc protocol _StdlibUnittestNSException {
453-
optional var name: AnyObject { get }
454-
}
455-
#endif
456-
457451
func _childProcess() {
458452
_stdlib_installTrapInterceptor()
459-
460-
#if _runtime(_ObjC)
461-
objc_setUncaughtExceptionHandler {
462-
var stderr = _Stderr()
463-
let maybeNSException = unsafeBitCast($0, to:_StdlibUnittestNSException.self)
464-
if let name = maybeNSException.name {
465-
print("*** [StdlibUnittest] Terminating due to uncaught exception " +
466-
"\(name): \($0)",
467-
to: &stderr)
468-
} else {
469-
print("*** [StdlibUnittest] Terminating due to uncaught exception: \($0)",
470-
to: &stderr)
471-
}
472-
}
473-
#endif
474-
475453
while let line = _stdlib_getline() {
476454
let parts = line._split(separator: ";")
477455
let testSuiteName = parts[0]

test/IDE/reconstruct_type_from_mangled_name.swift

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ struct Mystruct1 {
77
var intField = 3
88
// CHECK: decl: var intField: Int
99
}
10-
struct MyStruct2 {
11-
// CHECK: decl: struct MyStruct2
12-
init() {}
13-
// CHECK: decl: init()
14-
init(x: Int) {}
15-
// CHECK: decl: init(x: Int)
16-
init(x: Int, y: Int) {}
17-
// CHECK: decl: init(x: Int, y: Int)
18-
}
1910

2011
class Myclass1 {
2112
// CHECK: decl: class Myclass1
@@ -25,14 +16,13 @@ class Myclass1 {
2516

2617
func f1() {
2718
// CHECK: decl: func f1()
28-
var s1ins = Mystruct1() // Implicit ctor
19+
var s1ins = Mystruct1()
2920
// CHECK: decl: var s1ins: Mystruct1
30-
// CHECK: dref: init() for 'Mystruct1'
31-
_ = Mystruct1(intField: 1) // Implicit ctor
32-
// CHECK: dref: init(intField: Int) for 'Mystruct1'
21+
// FIXME: missing init()?
22+
// CHECK: dref: FAILURE for 'Mystruct1' usr=s:FV14swift_ide_test9Mystruct1cFT_S0_
23+
// CHECK: type: Mystruct1
3324

3425
s1ins.intField = 34
35-
// CHECK: type: Mystruct1
3626
// CHECK: type: Int
3727

3828
var c1ins = Myclass1()
@@ -80,9 +70,6 @@ class Myclass2 {
8070

8171
arr3.append(Myclass1())
8272
// CHECK: type: @lvalue Array<Myclass1> -> Myclass1 -> ()
83-
84-
_ = Myclass2.init()
85-
// CHECK: dref: init()
8673
}
8774
}
8875

validation-test/StdlibUnittest/NSException.swift

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)