diff --git a/NewSource/Socordia.CodeAnalysis/AST/TypeNames/QualifiedTypeName.cs b/NewSource/Socordia.CodeAnalysis/AST/TypeNames/QualifiedTypeName.cs index 0e18f4b..58bf543 100644 --- a/NewSource/Socordia.CodeAnalysis/AST/TypeNames/QualifiedTypeName.cs +++ b/NewSource/Socordia.CodeAnalysis/AST/TypeNames/QualifiedTypeName.cs @@ -5,14 +5,14 @@ public class QualifiedTypeName : TypeName public QualifiedTypeName(SimpleTypeName name) { Children.Add(name); + foreach (var child in name.Children) { - child.RemoveFromParent(); - Children.Add(child); + child.MoveTo(this); } } - public string Namespace => string.Join('.', Children.Take(Children.Count - 1)); + public string Namespace => string.Join('.', Children[..^1].Take(Children.Count - 1)); public TypeName Type => (TypeName)Children.Last; public override string ToString() => $"{Namespace}.{Type}"; diff --git a/NewSource/Socordia.CodeAnalysis/Socordia.CodeAnalysis.csproj b/NewSource/Socordia.CodeAnalysis/Socordia.CodeAnalysis.csproj index 6292088..c028204 100644 --- a/NewSource/Socordia.CodeAnalysis/Socordia.CodeAnalysis.csproj +++ b/NewSource/Socordia.CodeAnalysis/Socordia.CodeAnalysis.csproj @@ -7,7 +7,7 @@ - +