mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
There was a weird corner case with nested generic functions that would fail in the SIL verifier with some nonsense about archetypes out of context. Fix this the "right" way, by re-working Sema function declaration validation to assign generic signatures in a more principled way. Previously, nested functions did not get an interface type unless they themselves had generic parameters. This was inconsistent with methods nested inside generic types, which did get an interface type even if they themselves did not have a generic parameter list. There's some spill-over in SILGen from this change. Mostly it makes things more consistent and fixes some corner cases.
15 lines
526 B
Swift
15 lines
526 B
Swift
// This source file is part of the Swift.org open source project
|
|
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
|
|
// DUPLICATE-OF: 26832-swift-typechecker-conformstoprotocol.swift
|
|
// RUN: not %target-swift-frontend %s -parse
|
|
class B<T{enum S<h{protocol A{{
|
|
}
|
|
func g:A
|
|
struct A:B<T>
|
|
struct B<a
|