Răsfoiți Sursa

[net-lib] Do not check property access on -net-lib extern classes. Closes #3474

Cauê Waneck 10 ani în urmă
părinte
comite
48e2a29bf8

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

@@ -102,4 +102,24 @@ public class Base
 	}
 }
 
+// Issue #3474
+
+public interface ITextFile
+{
+	string Property { get; }
+}
+
+public interface ITextBuffer : ITextFile
+{
+}
+
+public interface IEditableTextFile : ITextFile
+{
+	new string Property { get; set; }
+}
+
+public interface IEditableTextBuffer : IEditableTextFile, ITextBuffer
+{
+}
+
 }

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

@@ -4,6 +4,7 @@ import haxe.test.Base;
 import haxe.test.Base.Base_InnerClass;
 import haxe.test.TEnum;
 import haxe.test.TEnumWithValue;
+import haxe.test.IEditableTextBuffer;
 import NoPackage;
 #if unsafe
 import cs.Pointer;
@@ -26,6 +27,23 @@ class TestCSharp extends Test
 		eq(Base._untyped, 40);
 	}
 
+	function testIssue3474()
+	{
+		var a:IEditableTextBuffer = null;
+		eq(a,null);
+		var didRun = false;
+		try
+		{
+			a.Property = "hello";
+		}
+		catch(e:Dynamic)
+		{
+			didRun = true;
+		}
+
+		t(didRun);
+	}
+
 #if unsafe
 	@:unsafe function testBoxedPointer()
 	{

+ 1 - 0
typeload.ml

@@ -976,6 +976,7 @@ let rec check_interface ctx c intf params =
 let check_interfaces ctx c =
 	match c.cl_path with
 	| "Proxy" :: _ , _ -> ()
+	| _ when c.cl_extern && Meta.has Meta.CsNative c.cl_meta -> ()
 	| _ ->
 	List.iter (fun (intf,params) -> check_interface ctx c intf params) c.cl_implements