Remove compiler warnings when compiled with 0.14 #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removing compiler warnings from gleam/otp when compiled with gleam 0.14.
Some comments:
supervisor.gleam
is due to a bug (Compiler warns of variable not used when alternative case clauses are present gleam#989)gleam/opt/port.{Port}
might mask another problem.Port
is used as a constructor in another type in the module but it is actuallyport.Port
that should be used (I think). I'd expect the compiler to fail here because of ambiguous use of types. I worked around the warning by using the type explicitlyprocess_test.gleam
relating toExitStatus
. As a quick workaround I add theExitStatus
to theopen_port
function. It passes the unit tests but I don't know if there are any side effects. TheExitStatus
flags makes the port send an exit status command to the port process when the external command exits. An alternative could be to remove thePortSetting
type completely and just send an empty list. To some degree I don't know if I agree with the warning as it is quite nice to be able to document all the options in a type even if you are not using them. Perhaps it doesn't matter much for a test module and that you normally would use a public type in this case.I've done the changes in separate commits based on the comments above, if anything need amending.