private static bool Compare(TypeStructure first, TypeStructure second)
        {
            return(first switch
            {
                GenericNameStructure firstGNS when second is GenericNameStructure secondGNS
                => CompareGenericTypeStructure(firstGNS, secondGNS),
                SimpleNameStructure firstSNS when second is SimpleNameStructure secondSNS
                => CompareIdentifierStructure(firstSNS, secondSNS),
                QualifiedNameStructure firstQNS when second is QualifiedNameStructure secondQNS
                => CompareQualifiedNameStructure(firstQNS, secondQNS),
                QualifiedNameStructure firstQNS when second is IdentifierStructure secondINS
                => CompareQNSWithINS(firstQNS, secondINS),
                SimpleNameStructure firstINS when second is QualifiedNameStructure secondQNS
                => CompareINSWithQns(firstINS, secondQNS),

                TypeArgStructure firstTAS when second is TypeArgStructure secondTAS
                => CompareTypeArgStructure(firstTAS, secondTAS),
                TupleTypeStructure firstTTS when second is TupleTypeStructure secondTTS
                => CompareTupleTypeStructure(firstTTS, secondTTS),
                PointerTypeStructure firstPTS when second is PointerTypeStructure secondPTS
                => ComparePointerTypeStructure(firstPTS, secondPTS),
                ArrayTypeStructure firstATS when second is ArrayTypeStructure secondATS
                => CompareArrayTypeStructure(firstATS, secondATS),
                NullableTypeStructure firstNTS when second is NullableTypeStructure secondNTS
                => CompareNullableTypeStructure(firstNTS, secondNTS),

                _ => false
            });
Beispiel #2
0
 public QualifiedNameStructure(TypeStructure left, SimpleNameStructure right)
 {
     Left  = left;
     Right = right;
 }
Beispiel #3
0
 public void SetRight(SimpleNameStructure structure) => Right = structure;
Beispiel #4
0
 public NameStructure AppendSimpleName(SimpleNameStructure structure)
 => new QualifiedNameStructure(this, structure);