www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14925] New: replaceInPlace fail compilation

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

          Issue ID: 14925
           Summary: replaceInPlace fail compilation
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: tsalm free.fr

This code won't compile 

 import std.array;
 import std.stdio;  

 void main()
 {
  char[] a = "mon texte 1".dup;
  char[] b = "abc".dup;
  size_t x   = 4;
  size_t y   = 9;
  replaceInPlace( a, x , y, b );
  writeln( a );
 }

Compilation fail with error :

replaceInPlace.d(11): Error: std.array.replaceInPlace called with argument
types (char[], uint, uint, char[]) matches both:
/usr/include/dmd/phobos/std/array.d(2279):     std.array.replaceInPlace!(char,
char[]).replaceInPlace(ref char[] array, uint from, uint to, char[] stuff)
and:
/usr/include/dmd/phobos/std/array.d(2312):     std.array.replaceInPlace!(char,
char[]).replaceInPlace(ref char[] array, uint from, uint to, char[] stuff)

Tested on DMD32 D Compiler v2.068.0-rc1

--
Aug 16 2015