2
0
Эх сурвалжийг харах

[cs] Native protected setters should be set as "never". Closes #4325

Cauê Waneck 10 жил өмнө
parent
commit
aac1718575

+ 1 - 1
gencs.ml

@@ -3813,7 +3813,7 @@ let convert_ilprop ctx p prop is_explicit_impl =
 			raise Exit (* special (?) getter; not used *)
 		| Some(_,m) when access m <> FAPublic -> (match access m with
 			| FAFamily
-			| FAFamOrAssem -> "null"
+			| FAFamOrAssem -> "never"
 			| _ -> "never");
 		| Some _ -> "set"
 	in

+ 7 - 0
tests/unit/native_cs/src/haxe/test/Base.cs

@@ -39,6 +39,13 @@ public class Base
 		get { return i * 20; }
 	}
 
+	public int Issue4325 { get; protected set; }
+
+	public void setIssue4325(int val)
+	{
+		this.Issue4325 = val;
+	}
+
 	public int this[int i, int j]
 	{
 		get { return i * j; }

+ 8 - 0
tests/unit/src/unit/TestCSharp.hx

@@ -24,6 +24,14 @@ class TestCSharp extends Test
 {
 #if cs
 
+	function testIssue4325()
+	{
+		var b = new Base();
+		eq(b.Issue4325, 0);
+		b.setIssue4325(10);
+		eq(b.Issue4325, 10);
+	}
+
 	// -net-lib tests
 	function testHaxeKeywords()
 	{