[Issue 23598] Another nasty forward reference bug
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Thu Jan 19 05:11:12 UTC 2023
    
    
  
https://issues.dlang.org/show_bug.cgi?id=23598
Walter Bright <bugzilla at digitalmars.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com
--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> ---
Doing a shrink on the test case:
  alias aliases(a...) = a;
  template sort(alias f, a...) {
    static if (a.length > 0) {
        alias x = f!(a[0]);
        alias sort = a;
    }
    else
        alias sort = a;
  }
  alias SortedItems = sort!(isDependencyOf, String);
  enum isDependencyOf(Item) = Item.DirectDependencies.length == 0;
  struct String {
    alias DirectDependencies = aliases!();
    enum l = SortedItems.length; // no property `length`
  }
If SortedItems is moved last, it compiles successfully.
--
    
    
More information about the Digitalmars-d-bugs
mailing list