Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private type should not be public #23518

Open
kbkpbot opened this issue Jan 19, 2025 · 2 comments · May be fixed by #23543
Open

Private type should not be public #23518

kbkpbot opened this issue Jan 19, 2025 · 2 comments · May be fixed by #23543
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Checker Bugs/feature requests, that are related to the type checker.

Comments

@kbkpbot
Copy link
Contributor

kbkpbot commented Jan 19, 2025

Describe the bug

Private type declare in other module, should not be public.

Reproduction Steps

append a line to vlib/builtin/cfns_wrapper.c.v

type MyPrivateType = u32

then create a file , such as :
p.v

fn main() {
        _ := MyPrivateType(0)
}

then compile it :

v p.v

Expected Behavior

The compiler should issue a error message "error: type MyPrivateType is private"

Current Behavior

compile pass

Possible Solution

No response

Additional Information/Context

Private const/function in builtin mod work OK, they are private to other modules.

V version

V 0.4.9 1b9f15d.5dd28cf

Environment details (OS name and version, etc.)

V full version V 0.4.9 1b9f15d.5dd28cf
OS linux, Ubuntu 24.04.1 LTS
Processor 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
Memory 2.34GB/15.51GB
V executable /media/HD/github/kbkpbot/v/v
V last modified time 2025-01-19 01:56:59
V home dir OK, value: /media/HD/github/kbkpbot/v
VMODULES OK, value: /home/mars/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /home/mars/v/sort
Git version git version 2.43.0
V git status weekly.2025.1-74-g5dd28cf9-dirty (5 commit(s) behind V master)
.git/config present true
cc version cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
gcc version gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
clang version Ubuntu clang version 18.1.3 (1ubuntu1)
tcc version tcc version 0.9.28rc 2024-07-31 HEAD@1cee0908 (x86_64 Linux)
tcc git status thirdparty-linux-amd64 0134e9b9
emcc version N/A
glibc version ldd (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@kbkpbot kbkpbot added the Bug This tag is applied to issues which reports bugs. label Jan 19, 2025
Copy link

Connected to Huly®: V_0.6-21947

@kbkpbot
Copy link
Contributor Author

kbkpbot commented Jan 19, 2025

This bug is related to issue #23453

@kbkpbot kbkpbot changed the title builtin's private type should not be public Private type should not be public Jan 21, 2025
@felipensp felipensp linked a pull request Jan 21, 2025 that will close this issue
@felipensp felipensp self-assigned this Jan 21, 2025
@felipensp felipensp added Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Checker Bugs/feature requests, that are related to the type checker. labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: Checker Bugs/feature requests, that are related to the type checker.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants