Files
swift-mirror/validation-test/compiler_crashers_fixed/28704-swift-newmangling-astmangler-appendcontext-swift-declcontext-const.swift
David Hart ecdcac5aa2 Resolve crasher 28704 (#8158)
This crash happens because shouldAddSelfFixit (a check for the expected_self_before_reference diagnotic) performs name lookup inside the parser, which causes a search for extensions, which triggers the mangler, which can get confused if we are in an unfinished declaration (a PatternBindingInitilizer in this case).

A cleaner fix would be to move that logic inside Sema, but it would require much more refactoring that I don’t feel comfortable doing. Instead, this band-aid checks if the innermost type is inside a local context. If that’s the case, we can ignore the search for extensions.
2017-03-17 18:43:23 -07:00

10 lines
446 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{var f={struct ManagedBuffer{var f=(t:f