Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[generator] do not emit static properties as instance. #159

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tools/generator/InterfaceGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void GenExtensionMethods (StreamWriter sw, string indent, CodeGenerationOptions

void GenProperties (StreamWriter sw, string indent, CodeGenerationOptions opt)
{
foreach (Property prop in Properties)
foreach (Property prop in Properties.Where (p => !p.Getter.IsStatic))
prop.GenerateDeclaration (sw, indent, opt, this, AssemblyQualifiedName + "Invoker");
}

Expand Down Expand Up @@ -256,22 +256,22 @@ void GenerateInvoker (StreamWriter sw, string indent, CodeGenerationOptions opt)
sw.WriteLine ();

HashSet<string> members = new HashSet<string> ();
GenerateInvoker (sw, Properties, indent + "\t", opt, members);
GenerateInvoker (sw, Methods, indent + "\t", opt, members);
GenerateInvoker (sw, Properties.Where (p => !p.Getter.IsStatic), indent + "\t", opt, members);
GenerateInvoker (sw, Methods.Where (m => !m.IsStatic), indent + "\t", opt, members);
if (FullName == "Java.Lang.ICharSequence")
GenCharSequenceEnumerator (sw, indent + "\t", opt);

foreach (InterfaceGen iface in GetAllDerivedInterfaces ()) {
GenerateInvoker (sw, iface.Properties, indent + "\t", opt, members);
GenerateInvoker (sw, iface.Methods.Where (m => !IsCovariantMethod (m) && !(iface.FullName.StartsWith ("Java.Lang.ICharSequence") && m.Name.EndsWith ("Formatted"))), indent + "\t", opt, members);
GenerateInvoker (sw, iface.Properties.Where (p => !p.Getter.IsStatic), indent + "\t", opt, members);
GenerateInvoker (sw, iface.Methods.Where (m => !m.IsStatic && !IsCovariantMethod (m) && !(iface.FullName.StartsWith ("Java.Lang.ICharSequence") && m.Name.EndsWith ("Formatted"))), indent + "\t", opt, members);
if (iface.FullName == "Java.Lang.ICharSequence")
GenCharSequenceEnumerator (sw, indent + "\t", opt);
}
sw.WriteLine ("{0}}}", indent);
sw.WriteLine ();
}

void GenerateInvoker (StreamWriter sw, List<Property> properties, string indent, CodeGenerationOptions opt, HashSet<string> members)
void GenerateInvoker (StreamWriter sw, IEnumerable<Property> properties, string indent, CodeGenerationOptions opt, HashSet<string> members)
{
foreach (Property prop in properties) {
if (members.Contains (prop.Name))
Expand Down Expand Up @@ -635,7 +635,7 @@ public void GenerateAbstractMembers (ClassGen gen, StreamWriter sw, string inden
m.GenerateAbstractDeclaration (sw, indent, opt, this, gen);
opt.ContextGeneratedMethods.Add (m);
}
foreach (Property prop in Properties) {
foreach (Property prop in Properties.Where (p => !p.Getter.IsStatic)) {
if (gen.ContainsProperty (prop.Name, false))
continue;
prop.GenerateAbstractDeclaration (sw, indent, opt, gen);
Expand Down