dotnet / dotnet/machinelearning
SchemaDefinition.Create picks up internal fields instead of just public only - affects F#
- Dominant language
- C#
- Stars
- 9.4k
- Forks
- 2k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 11
Description
This used to work before but now I cannot use CreateFromEnumerable in F# now.
In F#, we define mutable classes by annotating F# 'record' types with CLIMutable:
```F#
[]
type D =
{
Data : float[]
}
```
F# compiler generates IL that looks as follows:
```C#
public class D [ interface list ]
{
internal Data@ = Double[];
public Double[] Data
{
get
{
return Data@;
}
set
{
Data@ = value;
}
}
[ more methods including a default constructor ]
}
```
The SchemaDefinition.Create method picks up both "Data@" and "Data" as fields required by the schema. It should only pickup the public fields.
Please add unit tests for F# as well so these issues are caught earlier.
@dsyme
Contributor guide
Assessment
This issue has not been assessed yet.