Skip to content

fix: clearer error when %{target} is used without a (target ...) field#14668

Open
Alizter wants to merge 2 commits into
ocaml:mainfrom
Alizter:push-ysursvuvxnvv
Open

fix: clearer error when %{target} is used without a (target ...) field#14668
Alizter wants to merge 2 commits into
ocaml:mainfrom
Alizter:push-ysursvuvxnvv

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented May 22, 2026

This PR rewords the error raised when %{target} is used in a rule that has no (target ...) field, so it points at the missing field instead of mentioning "inferred rules".

Captures the current confusing 'You cannot use %{target} with inferred rules'
message that fires when a rule references %{target} but omits the (target ...)
field. The test asserts the situation should produce a clear error pointing
at the missing field. See ocaml#12439.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the push-ysursvuvxnvv branch from a8b6711 to 4615d86 Compare May 22, 2026 20:18
Point the user at the missing field instead of mentioning 'inferred rules'.

Fixes ocaml#12439.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the push-ysursvuvxnvv branch from 4615d86 to e5e2f06 Compare May 22, 2026 20:22
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.

Confusing message with erroneous rules

1 participant