We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: f3e4c0c6558ec266c5547d7f7e079fa3
Issue Description:
This code runs in playground but repl and swiftc reports error:
type 'Stack' nested in generic function 'foo' is not allowed
func foo() { class Stack<Element> { init() { array = [] } init(e: Element) { array = [e] } init<S: Sequence where S.Iterator.Element == Element>(es: S) { array = [Element](es) } var array: [Element] func push(_ e: Element) { array.append(e) } func push<S: Sequence where S.Iterator.Element == Element>(_ es: S) { array.append(contentsOf: es) } func pop() -> Element? { return array.popLast() } var isEmpty: Bool { return array.isEmpty } } func tailRecursive(_ stack: Stack<Int>) { guard let i = stack.pop() else { return } print(i) stack.push(i + 1) tailRecursive(stack) } tailRecursive(Stack(e: 0)) } foo()
The text was updated successfully, but these errors were encountered:
Fixed in Swift 3
Sorry, something went wrong.
No branches or pull requests
Additional Detail from JIRA
md5: f3e4c0c6558ec266c5547d7f7e079fa3
Issue Description:
This code runs in playground but repl and swiftc reports error:
The text was updated successfully, but these errors were encountered: