This commit is contained in:
parent
cb2e072d69
commit
3b8fa5ff34
19
TestSuite/interface5.pas
Normal file
19
TestSuite/interface5.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
type
|
||||
I1 = interface
|
||||
property p1: byte read write;
|
||||
end;
|
||||
//Ошибка: Класс t1 не реализует метод get_p1:byte интерфейса I1
|
||||
t1 = class(I1)
|
||||
public b: byte;
|
||||
b2: byte;
|
||||
public property I1.p1: byte read b write b;
|
||||
public property p1: byte read b2;
|
||||
end;
|
||||
|
||||
begin
|
||||
var o: I1 := new t1;
|
||||
o.p1 := 1;
|
||||
assert(o.p1 = 1);
|
||||
var o2 := o as t1;
|
||||
assert(o2.p1 = 0);
|
||||
end.
|
||||
|
|
@ -389,10 +389,18 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
public static string GetGetAccessorName(string name)
|
||||
{
|
||||
if (name.IndexOf(".") != -1)
|
||||
{
|
||||
return string.Format("{0}get_{1}", name.Substring(0, name.LastIndexOf('.') + 1), name.Substring(name.LastIndexOf('.')+1));
|
||||
}
|
||||
return GetAccessorName("get_{0}", name);
|
||||
}
|
||||
public static string GetSetAccessorName(string name)
|
||||
{
|
||||
if (name.IndexOf(".") != -1)
|
||||
{
|
||||
return string.Format("{0}set_{1}", name.Substring(0, name.LastIndexOf('.') + 1), name.Substring(name.LastIndexOf('.') + 1));
|
||||
}
|
||||
return GetAccessorName("set_{0}", name);
|
||||
}
|
||||
public static string GetAddHandler(string name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue