Skip to content

Mapping analysis: Unresolved <T> in concrete type #19

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. define
    public interface IEntity<T>
    {
        T ID { get; }
    }

    abstract public class BaseEntity<T> : IEntity<T>
    {
        private T _id;
        public virtual T ID
        {
            get { return _id; }
            protected set { _id = value; }
        }
    }

    public abstract class VersionedBaseEntity<T> : BaseEntity<T>
    {
        private int _version;
        public virtual int Version
        {
            get { return _version; }
        }
    }

    public abstract class BaseAPPEntity : VersionedBaseEntity<Guid>
    {
    }

    public partial class MyEntity: BaseAPPEntity 
    {
        public virtual string Name { get; set; }

        public MyEntity()
        {
        }
    }

Mapping:
<id name="ID" column="ID" type="Guid" access="field.lowercase-underscore">
   <generator class="guid.comb"/>
</id>


What is the expected output? What do you see instead?
Expected -> no warning
I see: Class name 'Guid' should be 'T' or a descendant for field '_id'

What version of the product are you using? On what operating system?
0.0.9.4

Please provide any additional information below.
Just downloaded latest trunk (version 20) and debugged. The problem is in
Analysis\MappingFile\MappingFileAnalysisElementProcessor.cs: 446.
R# says that fieldtype is T instead of Guid. I don't know how this works
(first time i see r# api), just tried a quickwatch to see if there are some
other property with 'Guid' type but i haven't found. So i dont' know if the
problem is in r# or in your code, the standard r# analysis worked fine.

Original issue reported on code.google.com by mtb.snow...@gmail.com on 5 Oct 2008 at 10:00

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions