Semantic Diff

#8921 Stop warning 20 on calls of open JS object methods

1 commit, rendered from its record.

Summary

RangeCommitsChangelogAreasJS output changesFormatsFailed checks
58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-89211๐Ÿ› Bug fixtypecheckertests0none0

Changelog draft

๐Ÿ› Bug fix
  • Fix warning 20 ("this argument will not be used by the function") firing on calls of methods of open JS object types, such as obj["getData"]("text/plain").

58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-8921

a085ae910 ยท Christoph Knittel ยท Oct 19, 2026

Stop warning 20 on calls of open JS object methods

๐Ÿ› Bug fixtypecheckertests

Calling a method read from an open JS object type, such as obj["getData"]("text/plain") with obj: {..}, no longer reports warning 20 "this argument will not be used by the function". The method's type is a fresh type variable, which the warning took as a sign that the function never returns, but the call passes its arguments to the JS method. Calls whose function is a fresh type variable for other reasons, such as failwith("x")(1), still warn.

Example ReScript

@get external clipboardData: string => {..} = "clipboardData"let text = clipboardData("event")["getData"]("text/plain")

Diagnostic output

Before: Warning number 20 on "text/plain":
  this argument will not be used by the function.
After: no warning.
๐Ÿ› Bug fixFix warning 20 ("this argument will not be used by the function") firing on calls of methods of open JS object types, such as obj["getData"]("text/plain").
No effect
Output: unchangedFormatting: unchangedFormats: nonePPX: unchangedEditor: unchanged
Tests
super_errors tests/build_tests/+ super_errors/fixtures/unused_argument_object_method.res+ super_errors/expected/unused_argument_object_method.res.expected
4 files ยท +30 โˆ’1 ยท changelog 1 ยท typechecker 1 ยท tests 2
Achanges/object-method-unused-argument.fix.md+1โˆ’0
Mcompiler/ml/typecore.ml+12โˆ’1
Atests/build_tests/super_errors/expected/unused_argument_object_method.res.expected+10โˆ’0
Atests/build_tests/super_errors/fixtures/unused_argument_object_method.res+7โˆ’0
with Claude Opus 5.5