Change type of params in methods' protocols to nongeneric

Summary:
It was mistake which I fix here. Type of param in protocols should be generated struct.

See generated struct in snap. It's exactly how it was in previous codegen

Reviewed By: RSNara

Differential Revision: D16770579

fbshipit-source-id: dac9c15c5d91a41ab2d06aea416f64bd7deb4476
This commit is contained in:
Michał Osadnik 2019-08-14 04:55:37 -07:00 коммит произвёл Facebook Github Bot
Родитель d3c30cdfe1
Коммит 024ce5d1d4
2 изменённых файлов: 14 добавлений и 10 удалений

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

@ -182,26 +182,30 @@ module.exports = {
.map(prop => {
const nativeArgs = prop.typeAnnotation.params
.map((param, i) => {
let paramObjCType;
if (
param.typeAnnotation.type === 'ObjectTypeAnnotation' &&
param.typeAnnotation.properties
) {
const variableName =
capitalizeFirstLetter(prop.name) +
capitalizeFirstLetter(param.name);
objectForGeneratingStructs.push({
name:
capitalizeFirstLetter(prop.name) +
capitalizeFirstLetter(param.name),
name: variableName,
object: {
type: 'ObjectTypeAnnotation',
properties: param.typeAnnotation.properties,
},
});
paramObjCType = `JS::Native::_MODULE_NAME_::::Spec${variableName}&`;
} else {
paramObjCType = translatePrimitiveJSTypeToObjCType(
param,
`Unspopported type for param "${param.name}" in ${
prop.name
}. Found: ${param.typeAnnotation.type}`,
);
}
const paramObjCType = translatePrimitiveJSTypeToObjCType(
param,
`Unspopported type for param "${param.name}" in ${
prop.name
}. Found: ${param.typeAnnotation.type}`,
);
return `${i === 0 ? '' : param.name}:(${paramObjCType})${
param.name
}`;

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

@ -149,7 +149,7 @@ inline NSString *JS::NativeSampleTurboModule::SpecDifficultAE::F() const
@protocol NativeSampleTurboModuleSpec <RCTBridgeModule, RCTTurboModule>
- (NSDictionary *) difficult:(NSDictionary *)A;
- (NSDictionary *) difficult:(JS::NativeSampleTurboModule::SpecDifficultA&)A;
@end