Skip to content

Commit

Permalink
Revert "[ReconstructType] Fix decl lookup when there are multiple con…
Browse files Browse the repository at this point in the history
…structors"

This reverts commit 65c86b7.

I attempted to resolve the merge conflict, but Jordan will need to do
a second check.
  • Loading branch information
milseman committed Mar 21, 2016
1 parent 0ac4fdd commit e86d3bd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 117 deletions.
9 changes: 0 additions & 9 deletions lib/IDE/ReconstructType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,15 +1058,6 @@ static void VisitNodeConstructor(
case TypeKind::Function: {
const AnyFunctionType *identifier_func =
identifier_type->getAs<AnyFunctionType>();

// inits are typed as (Foo.Type) -> (args...) -> Foo, but don't
// assert that in case we're dealing with broken code.
if (identifier_func->getInput()->is<AnyMetatypeType>() &&
identifier_func->getResult()->is<AnyFunctionType>()) {
identifier_func =
identifier_func->getResult()->getAs<AnyFunctionType>();
}

const AnyFunctionType *type_func =
type_result._types.front()->getAs<AnyFunctionType>();
if (CanType(identifier_func->getResult()
Expand Down
3 changes: 1 addition & 2 deletions stdlib/private/StdlibUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ set(swift_stdlib_unittest_module_depends
SwiftPrivate SwiftPrivatePthreadExtras SwiftPrivateLibcExtras)
set(swift_stdlib_unittest_framework_depends)
set(swift_stdlib_unittest_private_link_libraries)
set(swift_stdlib_unittest_compile_flags
"-Xfrontend" "-disable-objc-attr-requires-foundation-module")
set(swift_stdlib_unittest_compile_flags)

if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
list(APPEND swift_stdlib_unittest_platform_sources
Expand Down
22 changes: 0 additions & 22 deletions stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -448,30 +448,8 @@ let _crashedPrefix = "CRASHED:"
@_silgen_name("swift_stdlib_installTrapInterceptor")
func _stdlib_installTrapInterceptor()

#if _runtime(_ObjC)
@objc protocol _StdlibUnittestNSException {
optional var name: AnyObject { get }
}
#endif

func _childProcess() {
_stdlib_installTrapInterceptor()

#if _runtime(_ObjC)
objc_setUncaughtExceptionHandler {
var stderr = _Stderr()
let maybeNSException = unsafeBitCast($0, to:_StdlibUnittestNSException.self)
if let name = maybeNSException.name {
print("*** [StdlibUnittest] Terminating due to uncaught exception " +
"\(name): \($0)",
to: &stderr)
} else {
print("*** [StdlibUnittest] Terminating due to uncaught exception: \($0)",
to: &stderr)
}
}
#endif

while let line = _stdlib_getline() {
let parts = line._split(separator: ";")
let testSuiteName = parts[0]
Expand Down
21 changes: 4 additions & 17 deletions test/IDE/reconstruct_type_from_mangled_name.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ struct Mystruct1 {
var intField = 3
// CHECK: decl: var intField: Int
}
struct MyStruct2 {
// CHECK: decl: struct MyStruct2
init() {}
// CHECK: decl: init()
init(x: Int) {}
// CHECK: decl: init(x: Int)
init(x: Int, y: Int) {}
// CHECK: decl: init(x: Int, y: Int)
}

class Myclass1 {
// CHECK: decl: class Myclass1
Expand All @@ -25,14 +16,13 @@ class Myclass1 {

func f1() {
// CHECK: decl: func f1()
var s1ins = Mystruct1() // Implicit ctor
var s1ins = Mystruct1()
// CHECK: decl: var s1ins: Mystruct1
// CHECK: dref: init() for 'Mystruct1'
_ = Mystruct1(intField: 1) // Implicit ctor
// CHECK: dref: init(intField: Int) for 'Mystruct1'
// FIXME: missing init()?
// CHECK: dref: FAILURE for 'Mystruct1' usr=s:FV14swift_ide_test9Mystruct1cFT_S0_
// CHECK: type: Mystruct1

s1ins.intField = 34
// CHECK: type: Mystruct1
// CHECK: type: Int

var c1ins = Myclass1()
Expand Down Expand Up @@ -80,9 +70,6 @@ class Myclass2 {

arr3.append(Myclass1())
// CHECK: type: @lvalue Array<Myclass1> -> Myclass1 -> ()

_ = Myclass2.init()
// CHECK: dref: init()
}
}

Expand Down
67 changes: 0 additions & 67 deletions validation-test/StdlibUnittest/NSException.swift

This file was deleted.

0 comments on commit e86d3bd

Please sign in to comment.