www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16086] New: Imported function name shadows alias this member


          Issue ID: 16086
           Summary: Imported function name shadows alias this member
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: jbc.engelen gmail.com

The following code compiles with DMD 2.070, but not with 2.071:

module mod;

import std.range;

struct S
    struct Inner
        int unique_identifier_name;
        int tail;

    Inner inner;
    alias inner this;

    auto works()
        return unique_identifier_name;

    auto fails()
        return tail; // Line 22
        // The workaround:  return this.tail;

The 2.071 error is:
tail.d(22): Error: template tail(Range)(Range range, size_t n) if
(isInputRange!Range && !isInfinite!Range && (hasLength!Range ||
isForwardRange!Range)) has no type

See forum thread:
http://forum.dlang.org/post/pwpnfwrgtjabokpaorhz forum.dlang.org

May 28 2016