Question on declarations generation
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp, objective-c, typescript
- Área
- tooling
Línea de trabajo
Comienza con metadata-generator/src/TypeScript/DefinitionWriter.cpp alrededor de la línea 862 y compara su evaluación de tipos con las declaraciones de los headers de Objective-C y el ios.d.ts generado que se muestra aquí. Determina si es necesario modificar los headers de entrada o si el generador pierde tipos de protocolo; la finalización debe quedar marcada por un diagnóstico claro y por la conservación correcta de los tipos de argumentos y de retorno en lugar de NSObject.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello and thanks for your work.
I have a question regarding the generation of ios typescript declarations hoping to be in the right place.
We're using a robovm based toolchain to build a native library for iOS from Java-code. This toolchain emits header files in the following (shortened) form:
@protocol Option
-(NSString *) optionId;
-(NSString *) type;
@end
typedef NSObject<Option> Option;
@protocol Info
-(NSArray<NSObject<Option> *> *) getOptions;
@end
typedef NSObject<Info> Info;
the (shortened) declarations in ios.d.ts are
interface Option {
optionId(): string;
type(): string;
}
declare var Option: {
prototype: Option;
};
interface Info {
getOptions(): NSArray<NSObject>;
}
declare var Info: {
prototype: Info;
};
You may notice that the returned Array of getOptions is typed with NSObject instead of Option, which is the reason for this writing.
In fact are all argument- and return- types of functions which are defined by our headers typed with NSObject instead of the type which it should be.
After digging a while i understand that the types are evaluated in that function
https://github.com/NativeScript/ios/blob/main/metadata-generator/src/TypeScript/DefinitionWriter.cpp#L862
which might be wrong since it's been a while that i read some cpp code.
I assume that this codes falls back to NSObject if it cannot determine the correct type.
Note, that if i manually adjust the types in ios.d.ts everything works fine.
So basically my questions:
- Are our input (the header files) missing something or do they have to be different soemhow to get beter outcomes?
- If not would it be possible to patch the generator?
- Am i totally wrong here?
Cheers and again thanks for your work.
legion
- Lenguaje dominante
- JavaScript
- Estrellas
- 150
- Forks
- 43
- Merge medio
- 3 d 10 h
- PR fusionados (30 d)
- 22
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NativeScript/ios
-
isImplementedInClass leaks the losing sample instance on re-entrant or racing cache population Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
NativeScript/ios#459 · 1 comentario ·
-
worker.terminate() is a no-op during entry evaluation, and terminating there wedges teardown Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
NativeScript/ios#445 ·
-
Dificultad 3/5 3-5 días Aptitud para principiantes 66/100
NativeScript/ios#414 ·
-
question
Dificultad 4/5 3-5 días Aptitud para principiantes 34/100
NativeScript/ios#364 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
NativeScript/ios#355 ·
Todos los issues de NativeScript/ios
Issues similares
-
bug customer-eng Durable Agents Inngest status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
optimization optimization:agents-md-curator
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
AOSSIE-Org/OrgExplorer#253 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100