Skip to content

Uncapitalized cmi path in the error message #6914

Closed

Description

@mununki
// ABC.resi
type a = X | Y0
// ABC.res
type a = X | Y

The compiler failed to compile and show the message as below:

rescript: [3/3] src/ABC.cmj
FAILED: src/ABC.cmj

  We've found a bug for you!
  /Users/woonki/GitHub/projects/rescript-test2/src/ABC.res:1:1-14

  1 │ type a = X | Y
  2 │ 

  The implementation /Users/woonki/GitHub/projects/rescript-test2/src/ABC.res
  does not match the interface src/aBC.cmi: // ?? aBC.cmi
  Type declarations do not match:
    type a = X | Y
  is not included in
    type a = X | Y0
  /Users/woonki/GitHub/projects/rescript-test2/src/ABC.resi:1:1-15:
    Expected declaration
  /Users/woonki/GitHub/projects/rescript-test2/src/ABC.res:1:1-14:
    Actual declaration
  Fields number 2 have different names, Y and Y0.

FAILED: cannot make progress due to previous errors.

I guess here is the place makes the module name uncapitalized https://github.com/rescript-lang/rescript-compiler/blob/master/jscomp/ext/misc.ml#L221-L222

If we change the order of if else as finding the fullname first then ufullname as last would fix this issue, but I don't know the history why finding the uncapitalized file path first instead of original path.

Activity

  1. mununki commented on Jul 28, 2024

    @mununki
    MemberAuthor

    @cristianoc any guess about the implementation?

  2. cristianoc commented on Jul 28, 2024

    @cristianoc
    Collaborator

    @cristianoc any guess about the implementation?

    Not really but I'd start from the error message and add a few print statements until one finds the source.

  3. added this to the v12 milestone on Aug 28, 2024
  4. modified the milestones: v12, v12.1 on May 5, 2025
  5. added theissue type on Jul 14, 2025
  6. modified the milestones: v12.1, v13 on Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions