Skip to content

add return annotations to pure functions#7523

Closed
WalterBright wants to merge 1 commit intodlang:masterfrom
WalterBright:returnPure
Closed

add return annotations to pure functions#7523
WalterBright wants to merge 1 commit intodlang:masterfrom
WalterBright:returnPure

Conversation

@WalterBright
Copy link
Member

Fix errors:

std/bigint.d(409): Error: `pure` function `opOpAssign` returns parameter `this`, annotate with `return`
std/bigint.d(296): Error: template instance `std.bigint.BigInt.opOpAssign!("&", BigInt)` error instantiating
std/bigint.d(451):        instantiated from here: `opOpAssign!("&", int)`
std/bigint.d(2282):        instantiated from here: `opBinary!("&", int)`
std/bigint.d(299): Error: `pure` function `opOpAssign` returns parameter `this`, annotate with `return`
std/bigint.d(409): Error: `pure` function `opOpAssign` returns parameter `this`, annotate with `return`
std/bigint.d(430): Error: template instance `std.bigint.BigInt.opOpAssign!("*", BigInt)` error instantiating
std/bigint.d(2284):        instantiated from here: `opBinary!("*", BigInt)`
std/bigint.d(409): Error: `pure` function `opOpAssign` returns parameter `this`, annotate with `return`
std/bigint.d(430): Error: template instance `std.bigint.BigInt.opOpAssign!("%", BigInt)` error instantiating
std/bigint.d(2287):        instantiated from here: `opBinary!("%", BigInt)`
std/bigint.d(275): Error: `pure` function `opOpAssign` returns parameter `this`, annotate with `return`
std/bigint.d(299): Error: `pure` function `opOpAssign` returns parameter `this`, annotate with `return`
std/bigint.d(2288): Error: template instance `std.bigint.BigInt.opOpAssign!(">>", int)` error instantiating
std/bitmanip.d(1539): Error: `pure` function `reverse` returns parameter `this`, annotate with `return`
std/bitmanip.d(1599): Error: `pure` function `sort` returns parameter `this`, annotate with `return`
std/algorithm/searching.d(1609): Error: `pure` function `trustedMemchr` returns parameter `haystack`, annotate with `return`
std/algorithm/searching.d(1609): Error: `pure` function `trustedMemchr` returns parameter `haystack`, annotate with `return`
std/format.d(2635): Error: template instance `std.algorithm.searching.find!("a == b", string, const(char))` error instantiating
std/format.d(1875):        instantiated from here: `formatValueImpl!(void delegate(const(char)[]) pure nothrow @safe, const(real), char)`
std/complex.d(164):        instantiated from here: `formatValue!(void delegate(const(char)[]) pure nothrow @safe, const(real), char)`
std/complex.d(135):        instantiated from here: `toString!(void delegate(const(char)[]) pure nothrow @safe, char)`
std/complex.d(975):        instantiated from here: `Complex!real`
std/format.d(2737): Error: forward reference to inferred return type of function call `function () @trusted
{
import core.stdc.stdio : snprintf;
return snprintf(buf2.ptr, buf2.length, sprintfSpec.ptr, fs.width, fs.precision == fs.UNSPECIFIED ? -1 : fs.precision, tval);
}
()`
std/algorithm/searching.d(1609): Error: `pure` function `trustedMemchr` returns parameter `haystack`, annotate with `return`
std/algorithm/searching.d(1609): Error: `pure` function `trustedMemchr` returns parameter `haystack`, annotate with `return`
std/algorithm/searching.d(2701): Error: template instance `std.algorithm.searching.find!("a == b", const(char)[], dchar)` error instantiating

from dlang/dmd#10924

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#7523"

@WalterBright WalterBright added the Review:WIP Work In Progress - not ready for review or pulling label Jun 10, 2020
@RazvanN7
Copy link
Collaborator

@WalterBright This is currently failing all pipeline. What are your plans with this PR?

@RazvanN7
Copy link
Collaborator

As dlang/dmd#10924 was closed in favor of a different solution, I will close this as it is not needed anymore.

@RazvanN7 RazvanN7 closed this Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge:Needs Rebase Merge:stalled Review:Needs Work Review:WIP Work In Progress - not ready for review or pulling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants