Skip to content

Commit accee30

Browse files
authored
Psi/Record: fix for private constructors (#1009)
1 parent d29135c commit accee30

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

ReSharper.FSharp/src/FSharp/FSharp.Psi/src/Impl/DeclaredElement/CompilerGenerated/FSharpGeneratedConstructor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public override DeclaredElementType GetElementType() =>
2020

2121
public override IType ReturnType => PredefinedType.Void;
2222

23+
public override AccessRights GetAccessRights() =>
24+
ContainingType.GetRepresentationAccessRights();
2325

2426
public bool IsDefault => false;
2527
public bool IsParameterless => false;

ReSharper.FSharp/test/data/cache/csharpResolve/Records 09 - Private representation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
public Class1()
44
{
5-
var r = new Module.R(1);
5+
Module.R r = new Module.R(1);
66
var field = r.Field;
77
}
88
}

ReSharper.FSharp/test/data/cache/csharpResolve/Records 09 - Private representation.gold

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
{
33
public Class1()
44
{
5-
var r = new Module.R(1);
6-
var field = r.|Field|(0);
5+
Module.R r = new Module.|R|(0)(1);
6+
var field = r.|Field|(1);
77
}
88
}
99

1010
---------------------------------------------------------
11-
(0): ReSharper Underlined Error Highlighting: Cannot access internal property 'Field' here
11+
(0): ReSharper Underlined Error Highlighting: Cannot access internal constructor 'R(int)' here
12+
(1): ReSharper Underlined Error Highlighting: Cannot access internal property 'Field' here
1213
M:Module.R.#ctor(System.Int32)
1314
P:Module.R.Field

0 commit comments

Comments
 (0)