www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Broken examples

reply Imperatorn <johan_forsberg_86 hotmail.com> writes:
Basically none of the examples on here compile:
https://dlang.org/library/std/conv/parse.html

Any idea why?
Mar 05 2021
next sibling parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Friday, 5 March 2021 at 22:01:37 UTC, Imperatorn wrote:
 Basically none of the examples on here compile:
 https://dlang.org/library/std/conv/parse.html

 Any idea why?
Output: onlineapp.d(10): Error: template `std.conv.parse` cannot deduce function from argument types `!(bool, string, cast(Flag)false)(string)`, candidates are: /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2183): `parse(Target, Source)(ref Source source)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2280): `parse(Target, Source)(ref Source s)` with `Target = bool, Source = string` must satisfy the following constraint: ` isIntegral!Target` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2651): `parse(Target, Source)(ref Source source, uint radix)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2793): `parse(Target, Source)(ref Source s)` with `Target = bool, Source = string` must satisfy the following constraint: ` is(Target == enum)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2883): `parse(Target, Source)(ref Source source)` with `Target = bool, Source = string` must satisfy the following constraint: ` isFloatingPoint!Target` onlineapp.d(10): ... (6 more, -v to show) ... onlineapp.d(13): Error: template `std.conv.parse` cannot deduce function from argument types `!(bool, string, cast(Flag)true)(string)`, candidates are: /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2183): `parse(Target, Source)(ref Source source)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2280): `parse(Target, Source)(ref Source s)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2651): `parse(Target, Source)(ref Source source, uint radix)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2793): `parse(Target, Source)(ref Source s)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2883): `parse(Target, Source)(ref Source source)` onlineapp.d(13): ... (6 more, -v to show) ... onlineapp.d(16): Error: template `std.conv.parse` cannot deduce function from argument types `!(bool, string, cast(Flag)true)(string)`, candidates are: /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2183): `parse(Target, Source)(ref Source source)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2280): `parse(Target, Source)(ref Source s)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2651): `parse(Target, Source)(ref Source source, uint radix)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2793): `parse(Target, Source)(ref Source s)` /dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(2883): `parse(Target, Source)(ref Source source)` onlineapp.d(16): ... (6 more, -v to show) ...
Mar 05 2021
prev sibling next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Mar 05, 2021 at 10:01:37PM +0000, Imperatorn via Digitalmars-d-learn
wrote:
 Basically none of the examples on here compile:
 https://dlang.org/library/std/conv/parse.html
 
 Any idea why?
File a bug. T -- By understanding a machine-oriented language, the programmer will tend to use a much more efficient method; it is much closer to reality. -- D. Knuth
Mar 05 2021
parent NonNull <non-null use.startmail.com> writes:
On Friday, 5 March 2021 at 22:59:09 UTC, H. S. Teoh wrote:
 On Fri, Mar 05, 2021 at 10:01:37PM +0000, Imperatorn via 
 Digitalmars-d-learn wrote:
 Basically none of the examples on here compile: 
 https://dlang.org/library/std/conv/parse.html
 
 Any idea why?
File a bug. T
Sad that there's such an uninviting space for outsiders coming in.
Mar 05 2021
prev sibling parent reply MoonlightSentinel <moonlightsentinel disroot.org> writes:
On Friday, 5 March 2021 at 22:01:37 UTC, Imperatorn wrote:
 Any idea why?
The examples are compiled using an older host compiler (__VERSION__ is 2.093) but use features introduced in a later version. This will be fixed by upgrading the compiler (the examples are checked using current master IIRC).
Mar 05 2021
parent reply Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Saturday, 6 March 2021 at 01:30:35 UTC, MoonlightSentinel 
wrote:
 On Friday, 5 March 2021 at 22:01:37 UTC, Imperatorn wrote:
 Any idea why?
The examples are compiled using an older host compiler (__VERSION__ is 2.093) but use features introduced in a later version. This will be fixed by upgrading the compiler (the examples are checked using current master IIRC).
Are you sure? 🤔 I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta and none of them worked.
Mar 06 2021
next sibling parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 3/6/21 12:15 AM, Imperatorn wrote:
 On Saturday, 6 March 2021 at 01:30:35 UTC, MoonlightSentinel wrote:
 On Friday, 5 March 2021 at 22:01:37 UTC, Imperatorn wrote:
 Any idea why?
The examples are compiled using an older host compiler (__VERSION__ is=
=20
 2.093) but use features introduced in a later version. This will be=20
 fixed by upgrading the compiler (the examples are checked using=20
 current master IIRC).
=20 Are you sure? =F0=9F=A4=94 =20 I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta and none o=
f=20
 them worked.
Are you getting the same errors with those dmd versions? My locally installed compiler is dmd 2.094.2, which seems to be too old=20 for parse's new doCount template parameter. (I look inside=20 /usr/include/dmd/phobos/std/conv.d on my Linux installation to be sure.) Ali
Mar 06 2021
next sibling parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Saturday, 6 March 2021 at 09:38:54 UTC, Ali Çehreli wrote:
 On 3/6/21 12:15 AM, Imperatorn wrote:
 On Saturday, 6 March 2021 at 01:30:35 UTC, MoonlightSentinel 
 wrote:
 [...]
Are you sure? 🤔 I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta and none of them worked.
Are you getting the same errors with those dmd versions? My locally installed compiler is dmd 2.094.2, which seems to be too old for parse's new doCount template parameter. (I look inside /usr/include/dmd/phobos/std/conv.d on my Linux installation to be sure.) Ali
I'll check when I'm at my computer again.
Mar 06 2021
prev sibling parent MoonlightSentinel <moonlightsentinel disroot.org> writes:
On Saturday, 6 March 2021 at 09:38:54 UTC, Ali Çehreli wrote:
 Are you getting the same errors with those dmd versions?

 My locally installed compiler is dmd 2.094.2, which seems to be 
 too old for parse's new doCount template parameter. (I look 
 inside /usr/include/dmd/phobos/std/conv.d on my Linux 
 installation to be sure.)

 Ali
The new template parameter was introduced in 2.095.0. See https://dlang.org/changelog/2.095.0.html#conv_parse_count
Mar 09 2021
prev sibling parent reply MoonlightSentinel <moonlightsentinel disroot.org> writes:
On Saturday, 6 March 2021 at 08:15:16 UTC, Imperatorn wrote:
 Are you sure? 🤔

 I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta 
 and none of them worked.
Yes. All of those were stuck at 2.093 due to some issues with Travis. We've resolved those issues over the last few days and automatically updated the host compilers today. Note that the output of doc examples is apparently cached, so you might need to make some changes to get the actual output (until the cache invalidates(?) ).
Mar 09 2021
parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Tuesday, 9 March 2021 at 15:44:39 UTC, MoonlightSentinel wrote:
 On Saturday, 6 March 2021 at 08:15:16 UTC, Imperatorn wrote:
 Are you sure? 🤔

 I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta 
 and none of them worked.
Yes. All of those were stuck at 2.093 due to some issues with Travis. We've resolved those issues over the last few days and automatically updated the host compilers today. Note that the output of doc examples is apparently cached, so you might need to make some changes to get the actual output (until the cache invalidates(?) ).
Oh, I see. Thanks for fixing it! ☀️
Mar 09 2021