Struct Constructor - Ambiguous

4 posts, 0 answers
  1. David Hollins
    David  Hollins avatar
    15 posts
    Member since:
    Dec 2009

    Posted 02 May 2010 Link to this post

    When using a struct as a persistent type, Open Access seems to add a parameterless constructor to the struct during enhancement.  This causes problems because then the "default" and this parameterles constructor make the std call to create this struct ambiguous.  C# forbids parameterless constructors on structs and this is causing an issue.

    Has anyone else seen this and if so, was there a fix or workaround?

    Thanks
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 03 May 2010 Link to this post

    Hi David Hollins,
    We are adding this parameterless ctor to the struct to initialize our change tracking and lazy loading. I never saw ambigious warnings because of that. Can you tell me where you see such and why it is a problem?

    Kind regards,
    Jan Blessenohl
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. David Hollins
    David  Hollins avatar
    15 posts
    Member since:
    Dec 2009

    Posted 24 May 2010 Link to this post

    I usually see it when I am referencing one of these structs in our web code inside a page or control.  Visual Studio 2008 flags it as a problem but everything compiles alright and runs fine.

    I have attached a screenshot showing the error in Visual Studio.
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 28 May 2010 Link to this post

    Hello David Hollins,
    I have digged into your problem today and my feeling is that the error is not reported by visual studio but by resharper or some other tool. Nevertheless I have found out that we might have misinterpreted the IL specification and we will see if we can get the same functionality with a different implementation.

    Kind regards,
    Jan Blessenohl
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top