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

Trivial: Silence buggy deprecation #2792

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion source/dub/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ deprecated("This function wasn't intended for public use - open an issue with Du
PackageSupplier[] defaultPackageSuppliers()
{
logDiagnostic("Using dub registry url '%s'", defaultRegistryURLs[0]);
return [new FallbackPackageSupplier(defaultRegistryURLs.map!getRegistryPackageSupplier.array)];
return [new FallbackPackageSupplier(defaultRegistryURLs.map!_getRegistryPackageSupplier.array)];
}

/** Returns a registry package supplier according to protocol.
Expand All @@ -73,6 +73,13 @@ PackageSupplier[] defaultPackageSuppliers()
*/
deprecated("This function wasn't intended for public use - open an issue with Dub if you need it")
PackageSupplier getRegistryPackageSupplier(string url)
{
return _getRegistryPackageSupplier(url);
}

// Private to avoid a bug in `defaultPackageSuppliers` with `map` triggering a deprecation
// even though the context is deprecated.
private PackageSupplier _getRegistryPackageSupplier(string url)
{
switch (url.startsWith("dub+", "mvn+", "file://"))
{
Expand Down
Loading