Bug 18940 – [std.net.curl]Can't run examples on page. cannot implicitly convert expression ... `char[]` to `string`

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-06-04T00:27:12Z
Last change time
2018-06-04T10:49:19Z
Assigned to
No Owner
Creator
Kyle Siefring

Comments

Comment #0 by kyle.siefring — 2018-06-04T00:27:12Z
import std.net.curl; // Two requests below will do the same. string content; // Explicit connection provided content = get!HTTP("dlang.org"); // Guess connection type by looking at the URL content = get!AutoProtocol("ftp://foo.com/file"); // and since AutoProtocol is default this is the same as content = get("ftp://foo.com/file"); // and will end up detecting FTP from the url and be the same as content = get!FTP("ftp://foo.com/file"); get's output fails to convert to strings. output from compiler onlineapp.d(8): Error: cannot implicitly convert expression `get("dlang.org", opCall())` of type `char[]` to `string` onlineapp.d(11): Error: cannot implicitly convert expression `get("ftp://foo.com/file", AutoProtocol())` of type `char[]` to `string` onlineapp.d(13): Error: cannot implicitly convert expression `get("ftp://foo.com/file", AutoProtocol())` of type `char[]` to `string` onlineapp.d(15): Error: cannot implicitly convert expression `get("ftp://foo.com/file", opCall())` of type `char[]` to `string` output from programmer loud screeching noises and expletives.
Comment #1 by greensunny12 — 2018-06-04T01:38:17Z
Comment #2 by github-bugzilla — 2018-06-04T10:49:19Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/14fe47491b0ad48a53609019e9454936cd6a3c56 Fix Issue 18940 - [std.net.curl]Can't run examples on page. cannot implicitly convert expression https://github.com/dlang/phobos/commit/0eff855c7c3cf7ac7bfbb27fbfb68f7e32deb32f Merge pull request #6540 from wilzbach/fix-18940 Fix Issue 18940 - [std.net.curl]Can't run examples on page. cannot implicitly convert expression merged-on-behalf-of: Vladimir Panteleev <[email protected]>