*: remove newly superfluous static types on attributes
[nit.git] / contrib / objcwrapper / src / objc_model.nit
index 26a4df6..76b1c2d 100644 (file)
@@ -45,7 +45,7 @@ class ObjcModel
        # Objective-C types available in imported modules
        #
        # TODO seach in existing wrappers
-       private var imported_types: Array[String] = ["NSObject", "NSString"]
+       private var imported_types = ["NSObject", "NSString"]
 end
 
 # Objective-C class
@@ -67,8 +67,8 @@ end
 class ObjcMethod
        super ObjcProperty
 
-       # Scope: '+' for a static class method, and '-' for an instance method
-       var scope: Char is noinit, writable
+       # Is this a static class method declared with '+'? Otherwise it's an instance method.
+       var is_class_property: Bool = false is writable
 
        # Parameters of the method
        var params = new Array[ObjcParam]
@@ -77,7 +77,7 @@ class ObjcMethod
        var return_type: String is noinit, writable
 
        # Does this method look like a constructor/method?
-       fun is_init: Bool do return params.first.name.has_prefix("init")
+       fun is_init: Bool do return params.first.name.has_prefix("init") and not is_class_property
 end
 
 # Attribute of an `ObjcClass`
@@ -93,6 +93,9 @@ end
 
 # Property of an `ObjcClass`
 class ObjcProperty
+       # Introducing class
+       var objc_class: ObjcClass
+
        # Is this property to be commented out?
        var is_commented = false is writable
 end
@@ -116,4 +119,10 @@ class ObjcParam
 
        # Is this a parameter with only a `name`?
        var is_single = false is writable
+
+       redef fun to_s
+       do
+               if is_single then return name
+               return "{name}:({return_type}){variable_name}"
+       end
 end