コード例 #1
0
            public IEnumerable <T> CheckForCollisions <T> (IEnumerable <T> collection, string type) where T : IMemberDefinition
            {
                void FindCollisions(HashSet <string> names, string kind)
                {
                    var collisions = collection.Where(item => names.Contains(item.Name));

                    foreach (var collision in collisions)
                    {
                        SequencePoint point = ErrorEmitter.GetSequencePointFromMemberDefinition(collision);
                        ErrorEmitter.Error(ErrorCode.CollidingTypeName, $"All Unreal types live in same namespace. {type} '{collision.Name}' conflicts with existing native {kind}", point);
                    }
                    collection = collection.Except(collisions);
                }

                FindCollisions(Classes, "class");
                FindCollisions(Structs, "struct");
                FindCollisions(Enums, "enum");

                return(collection);
            }
コード例 #2
0
 public InvalidUnrealFunctionException(MethodDefinition method, string message, Exception innerException = null)
     : base(String.Format("Method '{0}' is not a valid Unreal function: {1}", method.Name, message), innerException, ErrorEmitter.GetSequencePointFromMemberDefinition(method))
 {
 }
コード例 #3
0
 public InvalidUnrealPropertyException(IMemberDefinition property, string message)
     : this(property.FullName, ErrorEmitter.GetSequencePointFromMemberDefinition(property), message)
 {
 }
コード例 #4
0
 public InvalidUnrealEnumException(TypeDefinition enom, string message)
     : base(String.Format("Enum '{0}' is not a valid Unreal enum: {1}", enom.FullName, message), ErrorEmitter.GetSequencePointFromMemberDefinition(enom))
 {
 }
コード例 #5
0
 public InvalidUnrealStructException(TypeDefinition strukt, string message)
     : base(String.Format("Struct '{0}' is not a valid Unreal struct: {1}", strukt.FullName, message), ErrorEmitter.GetSequencePointFromMemberDefinition(strukt))
 {
 }
コード例 #6
0
 public InvalidUnrealClassException(TypeDefinition klass, string message)
     : this(klass.FullName, ErrorEmitter.GetSequencePointFromMemberDefinition(klass), message)
 {
 }
コード例 #7
0
 public ConstructorNotFoundException(TypeDefinition type, string message)
     : base(message, ErrorEmitter.GetSequencePointFromMemberDefinition(type))
 {
 }
コード例 #8
0
 public InternalRewriteException(TypeDefinition type, string message)
     : base($"Internal error rewriting type {type.FullName}: {message}", ErrorEmitter.GetSequencePointFromMemberDefinition(type))
 {
 }
コード例 #9
0
 public UnsupportedPropertyInitializerException(PropertyDefinition property, SequencePoint seq)
     : base($"Property initializers are not supported for properties of type {property.PropertyType.FullName}", seq ?? ErrorEmitter.GetSequencePointFromMemberDefinition(property))
 {
 }
コード例 #10
0
 public UnableToFixPropertyBackingReferenceException(MethodDefinition constructor, PropertyDefinition property, OpCode opCode)
     : base($"The type {constructor.DeclaringType.FullName}'s constructor references the property {property.Name} using an unsupported IL pattern", ErrorEmitter.GetSequencePointFromMemberDefinition(constructor))
 {
 }
コード例 #11
0
 public InvalidConstructorException(MethodDefinition constructor, string message)
     : base(message, ErrorEmitter.GetSequencePointFromMemberDefinition(constructor))
 {
 }
コード例 #12
0
 public NotDerivableClassException(TypeDefinition klass, TypeDefinition superKlass)
     : base(String.Format("Class '{0}' is invalid because '{1}' may not be derived from in managed code.", klass.FullName, superKlass.FullName), ErrorEmitter.GetSequencePointFromMemberDefinition(klass))
 {
 }
コード例 #13
0
 public InvalidEnumMemberException(TypeDefinition enom, FieldReference field, string message, Exception innerException = null)
     : base(String.Format("Enum '{0}' has invalid field '{1}': {2}", enom.Name, field.Name, message), innerException, ErrorEmitter.GetSequencePointFromMemberDefinition(enom))
 {
 }