// user.swift// Unnecessary to `import MyClangModule` to induce the issueimportMySwiftLibrarylet instance =SwiftyName()
print(instance.foo)
print(instance.foobar)
The reason why this issue occurs is the same with SR-15586.
As described in the comment in "user.swift", `import MyClangModule` is not necessary to induce this error.
Only the existence of "MyClangModule" directory in one of the search paths causes the error.
Removing "MyClangModule" directory makes it possible to compile "user.swift".
ClangImporter has one unique instance of clang::Parser, clang::Preprocessor, and so on, but it has separate tables for clang::Module s and for declarations derived from simple C headers.
Such implementation brings about this kind of problems.
The text was updated successfully, but these errors were encountered:
YOCKOW commentedFeb 4, 2022
Environment
Swift 5.5.2
Additional Detail from JIRA
md5: 0b3495dbb0f5d0fc852529624d92ab13
relates to:
import Foundation
hides declarations (derived from C) in other modules on Linux.Issue Description:
Introduction
This is just a reduced case of SR-15586, however, it indicates that this issue occurs on any platforms; of course, even on macOS.
How to reproduce
Files
Contents of files
library.h
library.swift
MyClangModule/module.modulemap
user.swift
Steps
Compile library
Compile executable
Result
Discussion
The reason why this issue occurs is the same with SR-15586.
As described in the comment in "user.swift", `
import MyClangModule
` is not necessary to induce this error.Only the existence of "MyClangModule" directory in one of the search paths causes the error.
Removing "MyClangModule" directory makes it possible to compile "user.swift".
ClangImporter
has one unique instance ofclang::Parser
,clang::Preprocessor
, and so on, but it has separate tables forclang::Module
s and for declarations derived from simple C headers.Such implementation brings about this kind of problems.
The text was updated successfully, but these errors were encountered: