public MissingNamespaceSymbol(MissingModuleSymbol containingModule) { Debug.Assert((object)containingModule != null); _containingSymbol = containingModule; _name = string.Empty; }
public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) { return(true); } MissingModuleSymbol other = obj as MissingModuleSymbol; return((object)other != null && assembly.Equals(other.assembly)); }
public override bool Equals(Symbol obj, TypeCompareKind compareKind) { if (ReferenceEquals(this, obj)) { return(true); } MissingModuleSymbol other = obj as MissingModuleSymbol; return((object)other != null && assembly.Equals(other.assembly, compareKind)); }
public void TestMissingMetadataSymbol() { AssemblyIdentity missingAssemblyId = new AssemblyIdentity("foo"); AssemblySymbol assem = new MockAssemblySymbol("banana"); ModuleSymbol module = new MissingModuleSymbol(assem, ordinal: -1); NamedTypeSymbol container = new MockNamedTypeSymbol("TestClass", Enumerable.Empty<Symbol>(), TypeKind.Class); var mms1 = new MissingMetadataTypeSymbol.TopLevel(new MissingAssemblySymbol(missingAssemblyId).Modules[0], "Elvis", "Lives", 2, true); Assert.Equal(2, mms1.Arity); Assert.Equal("Elvis", mms1.NamespaceName); Assert.Equal("Lives", mms1.Name); Assert.Equal("Elvis.Lives<,>[missing]", mms1.ToTestDisplayString()); Assert.Equal("foo", mms1.ContainingAssembly.Identity.Name); var mms2 = new MissingMetadataTypeSymbol.TopLevel(module, "Elvis.Is", "Cool", 0, true); Assert.Equal(0, mms2.Arity); Assert.Equal("Elvis.Is", mms2.NamespaceName); Assert.Equal("Cool", mms2.Name); Assert.Equal("Elvis.Is.Cool[missing]", mms2.ToTestDisplayString()); Assert.Same(assem, mms2.ContainingAssembly); // TODO: Add test for 3rd constructor. }
public MissingAssemblySymbol(AssemblyIdentity identity) { Debug.Assert(identity != null); this.identity = identity; moduleSymbol = new MissingModuleSymbol(this, 0); }