Bug 16667 – [REG] dub test fails on std.conv after upgrade to dmd 2.072.0

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-11-07T15:22:00Z
Last change time
2017-01-16T23:25:05Z
Keywords
pull
Assigned to
code
Creator
igor.khasilev

Comments

Comment #0 by igor.khasilev — 2016-11-07T15:22:12Z
igor@ ~/test$ dmd --version DMD64 D Compiler v2.072.0 Copyright (c) 1999-2016 by Digital Mars written by Walter Bright igor@ ~/test$ dub --version DUB version 1.0.0, built on Oct 31 2016 To reproduce: 1. create empty dub package with "dub init" 2. change source/app.d to: import std.conv; import std.string; void main() { } unittest { ubyte[] a = "abc".representation.dup; string s = castFrom!(ubyte[]).to!(string)(a); } 3. dub test produce next output: No source files found in configuration 'library'. Falling back to "dub -b unittest". Performing "unittest" build using dmd for x86_64. test ~master: building configuration "application"... /usr/include/dmd/phobos/std/conv.d(5574,42): Error: @safe function 'std.conv.castFrom!(ubyte[]).__unittestL5557_1926' cannot call @system function 'std.conv.castFrom!long.to!(int, long).to' /usr/include/dmd/phobos/std/conv.d(5586,45): Error: @safe function 'std.conv.castFrom!(ubyte[]).__unittestL5557_1926' cannot call @system function 'std.conv.castFrom!(long*).to!(int, long*).to' source/app.d(9,17): Error: template instance std.conv.castFrom!(ubyte[]) error instantiating /usr/include/dmd/phobos/std/conv.d(5574,42): Error: @safe function 'std.conv.castFrom!long.__unittestL5557_1927' cannot call @system function 'std.conv.castFrom!long.to!(int, long).to' /usr/include/dmd/phobos/std/conv.d(5586,45): Error: @safe function 'std.conv.castFrom!long.__unittestL5557_1927' cannot call @system function 'std.conv.castFrom!(long*).to!(int, long*).to' /usr/include/dmd/phobos/std/conv.d(5574,22): Error: template instance std.conv.castFrom!long error instantiating source/app.d(9,17): instantiated from here: castFrom!(ubyte[]) /usr/include/dmd/phobos/std/conv.d(5586,45): Error: @safe function 'std.conv.castFrom!(long*).__unittestL5557_1928' cannot call @system function 'std.conv.castFrom!(long*).to!(int, long*).to' /usr/include/dmd/phobos/std/conv.d(5586,22): Error: template instance std.conv.castFrom!(long*) error instantiating source/app.d(9,17): instantiated from here: castFrom!(ubyte[]) dmd failed with exit code 1.
Comment #1 by public — 2016-11-10T15:39:55Z
Confirming regression from 2.071.2
Comment #2 by public — 2016-11-10T15:41:28Z
(dub is not necessary, compiling this snippet is sufficient) unittest { import std.conv; import std.string; ubyte[] a = "abc".representation.dup; string s = castFrom!(ubyte[]).to!(string)(a); }
Comment #3 by public — 2016-11-10T16:31:41Z
Comment #4 by code — 2016-11-16T23:45:49Z
Comment #5 by github-bugzilla — 2016-11-20T23:55:28Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0556bf138ed4678cb5ad870367065324fd4a5b4f fix Issue 16667 - wrong @safe unittest compilation error https://github.com/dlang/phobos/commit/2a6b43605d49b8c140e14dd43ecf783459bc5712 Merge pull request #4905 from MartinNowak/fix16667 fix Issue 16667 - wrong @safe unittest compilation error
Comment #6 by github-bugzilla — 2016-12-07T16:09:10Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0556bf138ed4678cb5ad870367065324fd4a5b4f fix Issue 16667 - wrong @safe unittest compilation error https://github.com/dlang/phobos/commit/2a6b43605d49b8c140e14dd43ecf783459bc5712 Merge pull request #4905 from MartinNowak/fix16667
Comment #7 by github-bugzilla — 2016-12-27T13:11:30Z
Commits pushed to scope at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0556bf138ed4678cb5ad870367065324fd4a5b4f fix Issue 16667 - wrong @safe unittest compilation error https://github.com/dlang/phobos/commit/2a6b43605d49b8c140e14dd43ecf783459bc5712 Merge pull request #4905 from MartinNowak/fix16667
Comment #8 by github-bugzilla — 2017-01-16T23:25:05Z
Commits pushed to newCTFE at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0556bf138ed4678cb5ad870367065324fd4a5b4f fix Issue 16667 - wrong @safe unittest compilation error https://github.com/dlang/phobos/commit/2a6b43605d49b8c140e14dd43ecf783459bc5712 Merge pull request #4905 from MartinNowak/fix16667