Skip to content

11.1.0-rc.4: weird misparsing errors #6677

Closed
@glennsl

Description

@glennsl

I'm getting some weird errors trying to compile a project with rescript v11.1.0-rc.4:

rescript: [594/711] src/Components_StructureFilter.cmj
FAILED: src/Components_StructureFilter.cmj

  We've found a bug for you!
  /home/glennsl/dev/remote/sensonomic/sensonomic/client/src/Components_StructureFilter.res:18:20-21

  16 ┆ ...{(structure: Tree.Structure.t<_>) => {
  17 ┆   let numLevels = switch numLevels {
  18 ┆   | Some(n) => n->Math.Int.min(structure.lvls->Array.length)
  19 ┆   | None => structure.lvls->Array.length
  20 ┆   }

  The value n- can't be found

rescript: [596/711] src/Components_StructureSelects.cmj
FAILED: src/Components_StructureSelects.cmj

  We've found a bug for you!
  /home/glennsl/dev/remote/sensonomic/sensonomic/client/src/Components_StructureSelects.res:57:13-20

  55 ┆     </Form.Labeled>
  56 ┆ 
  57 ┆   selects->Array.push(block)
  58 ┆   loop(selects, selected, i + 1)
  59 ┆ }

  The value selects- can't be found
  
  Hint: Did you mean selects?

rescript: [598/711] src/Components_StructureNavBar.cmj
FAILED: src/Components_StructureNavBar.cmj

  We've found a bug for you!
  /home/glennsl/dev/remote/sensonomic/sensonomic/client/src/Components_StructureNavBar.res:85:22-26

  83 ┆ | Some(n) =>
  84 ┆   if n < 0 {
  85 ┆     (structure.lvls->Array.length + n)->Math.Int.max(0)
  86 ┆   } else {
  87 ┆     n->Math.Int.min(structure.lvls->Array.length)

  The field lvls- does not belong to type Data.Flex.Tree.Structure.t
  
  This expression has type Data.Flex.Tree.Structure.t<unit>
Hint: Did you mean lvls?

rescript: [602/711] src/Components_Table.cmj
FAILED: cannot make progress due to previous errors.

Notice the similarity in the file names. Removing most, but not all, uses of the pipe operator in these files results in a successful build. There are 222 other modules that do not have these problems. Also, all the errors seem to happen within @react.component functions, but that might be incidental as most of the code within these files are. It doesn't fail on all uses of the pipe operator within components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions