Bug 53836 - F#: Code generated in Resource.designer.fs breaks the compilation
Summary: F#: Code generated in Resource.designer.fs breaks the compilation
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.1 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-03-23 09:47 UTC by Rob Lyndon
Modified: 2017-07-05 20:49 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Rob Lyndon 2017-03-23 09:47:45 UTC
In my Resource.designer.fs project, I have the following line:

            [<Microsoft.FSharp.Core.DefaultValueAttribute(false)>]
            static val mutable private ColorStateListItem:int[]

This is in the Resource_Styleable type.

But it is referred to in the UpdateIdValues() method in the Resources type:

                global.MyProject.Mobile.Android.Shared.Resource.Styleable.ColorStateListItem <- Resource_Styleable.ColorStateListItem

Unsurprisingly, this results in the error

The record, struct or class field 'RecyclerView' is not accessible from this code location	

The line

            [<Microsoft.FSharp.Core.DefaultValueAttribute(false)>]
            static val mutable private ColorStateListItem:int[]

should clearly never have been generated in this way. I don't see why it needs to be writable.

I need a fix or a workaround urgently.
Comment 1 Rob Lyndon 2017-03-23 11:29:22 UTC
There is a full repro at https://github.com/SpiegelSoft/FSharpResourcesBugRepro
Comment 2 Prashant [MSFT] 2017-07-05 08:28:09 UTC
Thank you for taking the time to submit the bug. We are unable to reproduce this issue. Please attach a reproduction to the bug by starting with a clean Xamarin.Android project and adding just the code necessary to demonstrate the issue.

Could you share the updated repo? It does not compile with/show the error with latest Xamarin.Forms libraries