Open
Description
Description
No response
Reproduction
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/include)
// RUN: split-file %s %t
//
// RUN: %target-swift-frontend -emit-module -module-name a -emit-module-path %t/include/a.swiftmodule %t/a.swift -cxx-interoperability-mode=default -I %t/include
// RUN: %target-swift-frontend -typecheck %t/b.swift -cxx-interoperability-mode=default -I %t/include
//--- include/module.modulemap
module cxx {
header "header.h"
export *
}
//--- include/header.h
template <typename T> struct Optional {
T value;
};
using OptionalBool = Optional<bool>;
inline OptionalBool getOptBool() {
return {true};
}
//--- a.swift
import cxx
public func bar() -> OptionalBool { getOptBool() }
//--- b.swift
import a
import cxx
public func baz() -> Bool { bar().value }
/Users/alatsis/Desktop/swiftlang/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/test-macosx-arm64/Interop/Cxx/Output/bug.swift.tmp/b.swift:3:29: error: cannot find 'bar' in scope; did you mean 'baz'?
1 | import a
2 | import cxx
3 | public func baz() -> Bool { bar().value }
| | `- error: cannot find 'bar' in scope; did you mean 'baz'?
| `- note: 'baz' declared here
4 |
Expected behavior
Success.
Environment
Swift version 6.2-dev (LLVM 8bcf2671393ccfb, Swift 8acde34)
Additional information
No response