Circular dependency on foreign keys


#1

I have created two non-entity types (AbstractType A and AbstractType B) where A has a reference to B and vice versa. I also have two types that mix those (MixTypeA and MixTypeB). I am getting a circular dependency error when provisioning. Here is my code:

AbstractTypeA

    type AbstractTypeA {
        myKey: string

        typeB: [ AbstractTypeB ] ( myKey )
    }

AbstractTypeB

    type AbstractTypeB {
        myKey: string

        typeA: [ AbstractTypeA ] ( myKey )
    }

MixTypeA
entity type MixTypeA mixes AbstractTypeA schema name 'M_TYP_A'

MixTypeB
entity type MixTypeB mixes AbstractTypeB schema name 'M_TYP_B'

These are the provisioning errors I’m getting:

{fileUrl:"meta://types/MixTypeB.c3typ",lineNum:1,colNum:1,severity:"ERROR",message:"Circular dependency detected in type MixTypeB field typeA",targetType:"MixTypeB"}
{fileUrl:"meta://types/MixTypeA.c3typ",lineNum:1,colNum:1,severity:"ERROR",message:"Circular dependency detected in type MixTypeA field typeB",targetType:"MixTypeA"}

As a note when I was trying to get this example to fail when provisioning it worked fine when I just have two types that referenced each other. They only started to fail when I used the mixed those types.


#2

@brett.thompson Please file a ticket and I’ll investigate. I can’t say off the top of my head.