www.digitalmars.com         C & C++   DMDScript  

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

https://issues.dlang.org/show_bug.cgi?id=20719

          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

Trigger:

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


dmd`_D3dmd5dcast14implicitConvToFCQBc10expression10ExpressionCQCe5mtype4TypeZEQCu7globals5MATCH
+ 74

dmd`_D3dmd5mtype12TypeFunction9callMatchMFCQBlQBk4TypeACQBy10expression10ExpressioniPPxaPSQDg6dscope5ScopeZEQDy7globals5MATCH
+ 1744

--
Apr 03