Skip to content

Conversation

@ktoso
Copy link
Collaborator

@ktoso ktoso commented Aug 14, 2025

The reason here is that it's too easy to accidentally autocomplete into new Thing(bla) which can often be incorrect because we probably intended to call init on the Thing. This popped up with Data a lot, because it is so easy to wrongly use new Data rather than Data.init which performs the proper initialization

resolves #359

@ktoso ktoso force-pushed the wip-hide-the-unsafe-init branch from 5d8898f to 4f758ca Compare August 14, 2025 05:35
The reason here is that it's too easy to accidentally autocomplete into
new Thing(bla) which can often be incorrect because we probably intended
to call init on the Thing. This popped up with Data a lot, because it is
so easy to wrongly use new Data rather than Data.init which performs the
proper initialization
@ktoso ktoso force-pushed the wip-hide-the-unsafe-init branch from 4f758ca to af341a0 Compare August 14, 2025 08:37
@ktoso ktoso merged commit 69e487b into swiftlang:main Aug 14, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jextract: Hide constructors (pointer, arena) because they are too easy to mistakenly call

1 participant