Error when same C type is imported twice and the type is extended by one of the modules #75336
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
The attached test imports two C modules, both of which define the same C type (
enum __x_ABI_CWindows_CGraphics_CImaging_CBitmapPixelFormat
). One of the modules extends that type, but the other does not. A compiler error occurs when the extended type is accessed, presumably because the compiler doesn't recognize the existence of the extension.Build the attached minimal repro sample:
cmake -S . -B build -G Ninja
cmake --build build
A compiler error occurs, which should not:
main.swift:11:42: error: type 'BitmapPixelFormat' (aka '__x_ABI_CWindows_CGraphics_CImaging_CBitmapPixelFormat') has no member 'bgra8'
Reproduction
Repro: swiftImportTest.zip
Excerpts:
C Type being imported using InteropTest and InteropTest2 modules:
ModuleTest extends the C type:
ModuleTest2 does not extend the C type:
Use of type:
Expected behavior
This code should compile successfully.
Environment
compnerd.org Swift version 6.0-dev (LLVM a527f49f462b0d7, Swift eef85a7)
Target: x86_64-unknown-windows-msvc
Additional information
No response
The text was updated successfully, but these errors were encountered: