www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20719] New: Self struct definition causes stack overflow


          Issue ID: 20719
           Summary: Self struct definition causes stack overflow
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ben.james.jones gmail.com


import sumtype;
struct A{}

struct B {

  SumType!(This, A)[] elems;

relevant piece of the dmd stacktrace.  isTypeIsolated calls itself recursively
until the stack overflows. 

dmd`_D3dmd4func15FuncDeclaration14isTypeIsolatedMFCQBt5mtype4TypeZb + 254

dmd`implicitConvTo::ImplicitConvTo::visit(CallExp*) + 149

+ 74

+ 1744

Apr 03 2020