Skip to content

Stage-A: private functions with the same name in two modules collide in C #950

Closed

Description

@godofecht

Importing two modules that each define a private function with the same name fails to compile.

Repro: a program that imports tests.fixtures.module_collision.module_a and tests.fixtures.module_collision.module_b (the fixture used by tests/integration/test_private_function_module_collision.py).

Observed: error: conflicting types for '_same' from clang.

Reproduce with the Stage-A compiler built from compiler/bootstrap/flowc_stage_a.c:

cc -O2 -o compiler/build/flowc_bootstrap compiler/bootstrap/flowc_stage_a.c
FLOWC_BUNDLE=1 FLOWC_DIR=. FLOWC_IN=repro.flow FLOWC_OUT=repro.c compiler/build/flowc_bootstrap
cc -O0 -o repro repro.c -lm && ./repro; echo $?

The Python host (./flow test-lang) handles the same program correctly.

Found while porting the Python run tests to tests/lang/. The Python test stays until this is fixed: tests/integration/test_private_function_module_collision.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions