November 13, 2022 [Issue 23481] New: [inf loop] usertype enums opOpAssign cause an compile time infinite loop | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23481 Issue ID: 23481 Summary: [inf loop] usertype enums opOpAssign cause an compile time infinite loop Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: crazymonkyyy@gmail.com ``` struct flagenum(I=ubyte){ I i=1; alias i this; auto opBinary(string s)(int j){ assert(j==1); return typeof(this)(cast(I)(i*2)); } auto opEquals(I a){ return false; } } enum alphakey{a=flagenum!int(),b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z } flagenum!int alpha; void main(){ alpha&=alphakey.a; } ``` ``` dmd --version DMD64 D Compiler v2.101.0-rc.1 ``` related: https://issues.dlang.org/show_bug.cgi?id=23406 there's probably a lot of these -- |
Copyright © 1999-2021 by the D Language Foundation