Revert "[ReconstructType] Fix decl lookup when there are multiple constructors"

This reverts commit 65c86b713d.

I attempted to resolve the merge conflict, but Jordan will need to do
a second check.
This commit is contained in:
Michael Ilseman
2016-03-20 17:00:07 -07:00
parent 0ac4fdd7a9
commit e86d3bde6c
5 changed files with 5 additions and 117 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -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]

View File

@@ -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
@@ -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()
@@ -80,9 +70,6 @@ class Myclass2 {
arr3.append(Myclass1())
// CHECK: type: @lvalue Array<Myclass1> -> Myclass1 -> ()
_ = Myclass2.init()
// CHECK: dref: init()
}
}

View File

@@ -1,67 +0,0 @@
// RUN: %target-run-simple-swift 2>&1 | FileCheck %s
// REQUIRES: executable_test
// REQUIRES: objc_interop
import StdlibUnittest
import ObjectiveC
import Foundation
// Don't actually exit with a non-zero status, just say we're going to do it.
_setTestSuiteFailedCallback() { print("abort()") }
func raiseNSException() {
NSException(name: "Trogdor", reason: "Burnination", userInfo: nil).raise()
}
var TestSuiteCrashes = TestSuite("NSExceptionCrashes")
TestSuiteCrashes.test("uncaught") {
print("uncaught")
raiseNSException()
}
// CHECK-LABEL: stdout>>> uncaught
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Burnination
// CHECK: stderr>>> CRASHED: SIG
// CHECK: the test crashed unexpectedly
// CHECK: [ FAIL ] NSExceptionCrashes.uncaught
TestSuiteCrashes.test("crashesAsExpected") {
print("crashesAsExpected")
expectCrashLater()
raiseNSException()
}
// CHECK-LABEL: stdout>>> crashesAsExpected
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Burnination
// CHECK: stderr>>> OK: saw expected "crashed: sig
// CHECK: [ OK ] NSExceptionCrashes.crashesAsExpected
TestSuiteCrashes.test("crashesWithMessage")
.crashOutputMatches("libUnittest]")
.crashOutputMatches("Trogdor")
.crashOutputMatches("Burnination").code {
print("crashesWithMessage")
expectCrashLater()
raiseNSException()
}
// CHECK-LABEL: stdout>>> crashesWithMessage
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception Trogdor: Burnination
// CHECK: stderr>>> OK: saw expected "crashed: sig
// CHECK: [ OK ] NSExceptionCrashes.crashesWithMessage
TestSuiteCrashes.test("nonNSException")
.crashOutputMatches("countryside").code {
print("nonNSException")
expectCrashLater()
objc_exception_throw("countryside")
}
// CHECK-LABEL: stdout>>> nonNSException
// CHECK: stderr>>> *** [StdlibUnittest] Terminating due to uncaught exception: countryside
// CHECK: stderr>>> OK: saw expected "crashed: sig
// CHECK: [ OK ] NSExceptionCrashes.nonNSException
// CHECK: NSExceptionCrashes: Some tests failed, aborting
// CHECK: abort()
runAllTests()