My favourite game: DMD guess the error reason.
Iain Buclaw via Digitalmars-d
digitalmars-d at puremagic.com
Mon May 2 00:13:17 PDT 2016
Here's a small puzzle, in which there are both a simple and
cryptic combined. To make it easier, I've added a some multiple
choice answers at the bottom.
Winner of the simple puzzle gets a free beer from me at dconf.
Winner of the cryptic puzzle gets a free meal.
Q: What is the explanation for this error when building
std.bigint?
---
$ aarch64-linux-gnu-gdc -o std/bigint.o -Wall -Werror -g
-frelease -O2 -nostdinc -pipe -Wno-deprecated -c std/bigint.d
std/uni.d:2627:50: error: template
std.algorithm.searching.countUntil cannot deduce function from
argument types !("a[0] > 0x80")(CodepointInterval[]), candidates
are:
std/algorithm/searching.d:684:11: note:
std.algorithm.searching.countUntil(alias pred = "a == b", R,
Rs...)(R haystack, Rs needles) if (isForwardRange!R && Rs.length
> 0 && isForwardRange!(Rs[0]) == isInputRange!(Rs[0]) &&
is(typeof(startsWith!pred(haystack, needles[0]))) && (Rs.length
== 1 || is(typeof(countUntil!pred(haystack,
needles[1..__dollar])))))
std/algorithm/searching.d:772:11: note:
std.algorithm.searching.countUntil(alias pred = "a == b", R, N)(R
haystack, N needle) if (isInputRange!R &&
is(typeof(binaryFun!pred(haystack.front, needle)) : bool))
std/algorithm/searching.d:841:11: note:
std.algorithm.searching.countUntil(alias pred, R)(R haystack) if
(isInputRange!R && is(typeof(unaryFun!pred(haystack.front)) :
bool))
std/uni.d:1853:29: error: template instance
std.uni.InversionList!(GcPolicy) error instantiating
---
A:
---
[1]: Template deduction/matching failed to find a suitable
candidate for countUntil.
[2]: The ptrdiff_t and size_t types have a different size.
[3]: An untested version path had a semantic error.
[4]: An untested template instantiation had a missing member.
[5]: The template function core.varargs.va_arg does not exist.
[6]: A static assert was triggered in std.math.
[7]: The std.format module does not support 128-bit reals.
[8]: The compiler didn't add a predefined version for little/big
endian.
[9]: The order that modules are imported on AArch64 unearthed a
bug in the semantic pass.
---
Iain.
More information about the Digitalmars-d
mailing list