mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This is a diagnostic that is only really emitted as a fallback when the constraint system isn't able to better diagnose the expression. It's not particulary helpful for the user, and can be often be misleading since the underlying issue might not actually be an ambiguity, and the user may well already have a type annotation. Let's instead just emit the fallback diagnostic that we emit in all other cases, asking the user to file a bug.
27 lines
714 B
Swift
27 lines
714 B
Swift
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown -I %t/Inputs %t/test.swift -enable-experimental-cxx-interop
|
|
|
|
//--- Inputs/module.modulemap
|
|
module namespaces {
|
|
header "test.h"
|
|
requires cplusplus
|
|
}
|
|
//--- Inputs/test.h
|
|
namespace Parent {
|
|
inline namespace InlineChild {
|
|
|
|
void functionInInlineChild();
|
|
|
|
} // namespace InlineChild
|
|
} // namespace Parent
|
|
|
|
//--- test.swift
|
|
|
|
import namespaces;
|
|
|
|
// Swift's typechecker currently doesn't allow calling a function from inline namespace when it's referenced through the parent namespace.
|
|
func test() {
|
|
Parent.functionInInlineChild() // expected-error {{failed to produce diagnostic for expression}}
|
|
}
|