mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Swift 3.0 allowed constructing an enum or calling a function-typed property with multiple arguments even when a single argument of tuple type was expected. Emulate that in Swift 3 mode by wrapping in an extra level of parentheses when the situation comes up. Last vestiges of fallout from SE-0110. Hopefully last, anyway. A nice follow-up to this commit might be to /warn/ in Swift 3 mode when this happens. rdar://problem/30171399
23 lines
658 B
Swift
23 lines
658 B
Swift
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
|
|
// RUN: %target-swift-frontend %s -typecheck
|
|
|
|
// Issue found by https://github.com/austinzheng (Austin Zheng)
|
|
|
|
enum A<T> {
|
|
case Just(T)
|
|
case Error
|
|
}
|
|
|
|
func foo() -> A<(String, String?)> {
|
|
_ = A<(String, String?)>.Just("abc", "def")
|
|
_ = A.Just("abc", "def")
|
|
return A.Just("abc", "def")
|
|
}
|