mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When performing a name lookup from inside of a protocol or extension, skip directly to the source file context when we are done visiting the protocol or extension. Otherwise, if we have invalid code where the protocol or extension is nested inside another type, we might find a member whose type contains generic parameters of the outer type; these parameters will not resolve, since we do not model protocols or extensions nested inside generic contexts (yet?). This supercedes an earlier workaround for a similar issue; the new workaround fixes more crashes. This is needed to avoid crasher regressions with an upcoming patch.
11 lines
471 B
Swift
11 lines
471 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: not %target-swift-frontend %s -emit-ir
|
|
protocol A{{}struct A{typealias a:Self
|
|
protocol P{extension{lazy var f=A.a
|