www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17801] New: Date.fromISOExtString broken in 2.076 because of

https://issues.dlang.org/show_bug.cgi?id=17801

          Issue ID: 17801
           Summary: Date.fromISOExtString broken in 2.076 because of
                    changed type specifier
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: neuranuz gmail.com

After upgrading to DMD 2.076 the following code was broken, because of changed
type specifier:

import std.stdio;
import std.datetime;

DateTime DateTimeFromPGTimestamp( const(char)[] dateString )
{
    auto temp = dateString[0..10] ~ "T" ~ dateString[11..19];
    return DateTime.fromISOExtString(temp);
}


void main()
{
    auto result = DateTimeFromPGTimestamp("No matter what is there!");

}

Compilation output:
/opt/compilers/dmd2/include/std/datetime/date.d(3197): Error: cannot implicitly
convert expression `strip(isoExtString)` of type `const(char)[]` to
`immutable(string)`
/d578/f601.d(7): Error: template instance
std.datetime.date.DateTime.fromISOExtString!(char[]) error instantiating

Link to compile online:
https://dpaste.dzfl.pl/06c270576110

--
Sep 03