[objc] Skip generation for subclasses of unsupported types (#250)

In such case a warning will be displayed and nothing will be generated.

Test added so we can ensure such condition does not stop the generation
with an error.
This commit is contained in:
Sebastien Pouliot 2017-05-03 10:51:01 -04:00 коммит произвёл GitHub
Родитель 8eb24d61a4
Коммит c2968251bd
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -74,7 +74,9 @@ namespace ObjC {
} }
break; break;
} }
return true;
var base_type = t.BaseType;
return (base_type == null) || base_type.Is ("System", "Object") ? true : IsSupported (base_type);
} }
protected IEnumerable<Type> GetTypes (Assembly a) protected IEnumerable<Type> GetTypes (Assembly a)

Просмотреть файл

@ -80,3 +80,10 @@ public static class Type_String
public static string NonEmptyString { get { return "Hello World"; } } public static string NonEmptyString { get { return "Hello World"; } }
} }
// objc: this type won't be generated (Exception is not supported) but the generation will succeed (with warnings)
public class MyException : Exception {
}
// objc: this type won't be generated (subclassing an unsupported type) but the generation will succeed (with warnings)
public class MyNextException : MyException {
}