internal void MergeWith(TypeScopeImpl other) { Debug.Assert(other != null); if (TypeKey != other.TypeKey) { throw new InvalidOperationException($"Unable to merge type '{_typeDef}' with '{other._typeDef}'."); } _typeDef.MergeWith(other._typeDef); CodePart.MergeWith(other.CodePart); MergeTypes(other); _funcs.MergeWith(Workspace, this, other._funcs); }
internal void MergeWith(NamespaceScopeImpl other) { Debug.Assert(other != null); _beforeNamespace.MergeWith(other._beforeNamespace); foreach (var u in other._usings) { DoEnsureUsing(u.Key, u.Value.Key, u.Value.Value); } CodePart.MergeWith(other.CodePart); MergeTypes(other); foreach (var oNS in other._subNamespaces) { var my = _subNamespaces.FirstOrDefault(x => x.Name == oNS.Name); if (my == null) { my = new NamespaceScopeImpl(Workspace, this, oNS.Name); _subNamespaces.Add(my); } my.MergeWith(oNS); } }
internal void MergeWith(FunctionScopeImpl other) { Debug.Assert(other != null); CodePart.MergeWith(other.CodePart); _funcs.MergeWith(Workspace, this, other._funcs); }