Bug 17472 – [Reg 2.075] typeof(stdin) is no longer a File

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-06-06T22:05:45Z
Last change time
2018-01-05T13:29:11Z
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2017-06-06T22:05:45Z
cat > bug.d << CODE import std.stdio; private void threadWriter(alias OUT, alias ERR)() { OUT = typeof(OUT)("/dev/null", "w"); ERR = typeof(ERR)("/dev/null", "w"); } alias stdWriter = threadWriter!(stdout, stderr); CODE dmd -c bug ---- /home/dawg/Code/D/bug.d(5): Error: expected 0 arguments, not 2 for non-variadic function type nothrow @nogc ref @system File() /home/dawg/Code/D/bug.d(6): Error: expected 0 arguments, not 2 for non-variadic function type nothrow @nogc ref @system File() /home/dawg/Code/D/bug.d(9): Error: template instance bug.threadWriter!(makeGlobal, makeGlobal) error instantiating ---- Breaks https://github.com/atilaneves/unit-threaded. Happens because stdin is now an alias. alias stdin = makeGlobal!(core.stdc.stdio.stdin); Introduced with https://github.com/dlang/phobos/pull/5421
Comment #1 by andrei — 2017-06-06T23:17:16Z
I think we should change client code. It is understood that the change is liable to regressions. We really should get rid of library initialization code.
Comment #2 by code — 2017-06-09T12:30:02Z
(In reply to Andrei Alexandrescu from comment #1) > We really should get rid of library initialization > code. Why did that became a goal btw?
Comment #3 by andrei — 2017-06-09T12:44:14Z
(In reply to Martin Nowak from comment #2) > (In reply to Andrei Alexandrescu from comment #1) > > We really should get rid of library initialization > > code. > > Why did that became a goal btw? Thanks for asking. It's "Better support for C-style libraries with light or no runtime" in https://wiki.dlang.org/Vision/2017H1. Initializing all of druntime and phobos lazily would make a lot of things better.
Comment #4 by github-bugzilla — 2017-06-09T13:33:15Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3caa34f219cebaf37b75ce7384a3a40dbb87fe1e fix Issue 17472 - typeof(stdin) is no longer a File https://github.com/dlang/phobos/commit/ff3c3dfb00d0db8cfb0c6571ad689a9e6080bfd7 Merge pull request #5454 from MartinNowak/fix17472 fix Issue 17472 - typeof(stdin) is no longer a File merged-on-behalf-of: Andrei Alexandrescu <[email protected]>
Comment #5 by dfj1esp02 — 2017-06-14T15:05:23Z
(In reply to Andrei Alexandrescu from comment #3) > light or no runtime That rules out druntime and phobos for good.
Comment #6 by github-bugzilla — 2017-06-17T11:35:10Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3caa34f219cebaf37b75ce7384a3a40dbb87fe1e fix Issue 17472 - typeof(stdin) is no longer a File https://github.com/dlang/phobos/commit/ff3c3dfb00d0db8cfb0c6571ad689a9e6080bfd7 Merge pull request #5454 from MartinNowak/fix17472
Comment #7 by github-bugzilla — 2018-01-05T13:29:11Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/3caa34f219cebaf37b75ce7384a3a40dbb87fe1e fix Issue 17472 - typeof(stdin) is no longer a File https://github.com/dlang/phobos/commit/ff3c3dfb00d0db8cfb0c6571ad689a9e6080bfd7 Merge pull request #5454 from MartinNowak/fix17472