DMD Access Violation

Jonathan Marler via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 26 11:07:44 PDT 2016


My dmd compiler gets an Access Violation when compiling this code:

     public template TemplateWrapper(T)
     {
         alias ToAlias = T;
     }
     public class Bar : Foo
     {
         TemplateWrapper!(Bar) something;
     }
     public class Foo
     {
         static class StaticClass : Bar { }
     }

If I move Foo to appear before Bar, the AccessViolation goes away:

     public template TemplateWrapper(T)
     {
         alias ToAlias = T;
     }
     public class Foo
     {
         static class StaticClass : Bar { }
     }
     public class Bar : Foo
     {
         TemplateWrapper!(Bar) something;
     }

Also, if I remove the TemplateWrapper, the AccessViolation goes 
away:

     public class Bar : Foo
     {
         Bar something;
     }
     public class Foo
     {
         static class StaticClass : Bar { }
     }

Does anyone else get an access violation in the first case? Is 
this a known bug?



More information about the Digitalmars-d mailing list