Skip to content

refactor: return an integer from Inspector:getId - #81

Open
chernetskyi wants to merge 1 commit into
kikito:masterfrom
chernetskyi:refactor/get-id-returns-integer
Open

chernetskyi wants to merge 1 commit into
kikito:masterfrom
chernetskyi:refactor/get-id-returns-integer

Conversation

@chernetskyi

Copy link
Copy Markdown

Both call sites feed the result straight into a '%d' format, so the id was converted to a string only for string.format to convert it back. ids already holds integers.

The round trip relied on Lua's automatic string to number coercion, which is absent from an interpreter built with LUA_NOCVTS2N. It also made 'tl check' report the two call sites as passing a string where an integer is expected; both of those errors are now gone.

The format strings are unchanged and so is the rendered output.

Both call sites feed the result straight into a '%d' format, so the id
was converted to a string only for string.format to convert it back.
ids already holds integers.

The round trip relied on Lua's automatic string to number coercion,
which is absent from an interpreter built with LUA_NOCVTS2N. It also
made 'tl check' report the two call sites as passing a string where an
integer is expected; both of those errors are now gone.

The format strings are unchanged and so is the rendered output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant