jolie
jolie copied to clipboard
ProgramInspector finds type with a name prefixed with <NUM>#
When executing joliedoc against this service, the resulting outputport contains types with a name prefixed with <NUM>#
from file import File
service test {
embed File as File
main {
nullProcess
}
}
The result is:
A test has been added for reproducing the bug here https://github.com/jolie/jolie/tree/bug_inspector
The test just uses metajolie for checking the name of the types produced by jolie.lang.parse.util.ProgramInspector;
@kicito Could you have a look at this?
Sure! let me try :)
Hi, it seems like the prefix is only added to fault type in OLParser. To prevent the infinite loop on linking types phase, I believe.
https://github.com/jolie/jolie/blob/8ce438aaf986cde9e6770678e7db80bfac149863/libjolie/src/main/java/jolie/lang/parse/OLParser.java#L1987-L1989
A (perhaps) simple solution is we can modify the return content of type.id() and type.name() which are currently identical. One for the machine-related operations and the other for readability.
Having a method that returns the "simple" name of a type sounds sensible to me. Not sure if we should use id
for that. Can you do a quick check to see where id
is used? It's not a method that implements an interface, so we could easily rename it to "simpleName", for example.
Sure, just did a check and I think it should be an easy fix.
@kicito any news on this one?