[Issue 16086] New: Imported function name shadows alias this member
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sat May 28 02:56:32 PDT 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=16086
          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 at puremagic.com
          Reporter: jbc.engelen at 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
--
    
    
More information about the Digitalmars-d-bugs
mailing list