コード例 #1
0
		internal ISet<TypeDescriptor> GetPotentialTypes(PropGraphNodeDescriptor n, PropagationGraph propGraph, ICodeProvider codeProvider)
		{
			var result = new HashSet<TypeDescriptor>();
			foreach (var typeDescriptor in propGraph.GetTypes(n))
			{
				// TO-DO fix by adding a where T: AnalysisType
				if (typeDescriptor.IsConcreteType)
				{
					result.Add(typeDescriptor);
				}
				else
				{
                    // If it is a declaredTyped it means we were not able to compute a concrete type
                    // Therefore, we instantiate all compatible types for the set of instantiated types
					//result.UnionWith(this.InstatiatedTypes.Where(iType => iType.IsSubtype(typeDescriptor)));
                    Contract.Assert(this.InstatiatedTypes != null);
                    // Diego: This requires a Code Provider. Now it will simply fail.
                    result.UnionWith(this.InstatiatedTypes.Where(candidateTypeDescriptor
                                            => codeProvider.IsSubtype(candidateTypeDescriptor, typeDescriptor)));
				}
			}
			return result;
		}