Skip to content

Prop punning when types don't match results in I/O error: _none_: No such file or directory #7532

Closed
@mediremi

Description

@mediremi

For version v12.0.0-alpha.14 (commit e63147f), using component prop punning with mismatched types results in I/O error: _none_: No such file or directory:

module Level2 = {
  @react.component
  let make = (~someProp: float) => {
    React.null
  }
}

module Level1 = {
  @react.component
  let make = (~someProp: array<int>) => {
    <Level2 someProp />
  }
}
FAILED: File.cmj

  We've found a bug for you!
  /home/mediremi/test/File.res

  I/O error: _none_: No such file or directory

In v12.0.0-alpha.12 & v12.0.0-alpha.13, a type error is shown but without any line numbers:

FAILED: File.cmj

  We've found a bug for you!
  /home/mediremi/test/File.res

  This has type: array<int>
  But it's expected to have type: float

(Playground link for v12.0.0-alpha.13)

In v12.0.0-alpha.11 and below, full location information is included in the error:

FAILED: File.cmj

  We've found a bug for you!
  /home/mediremi/test/File.res:11:15-22

   9 │  @react.component
  10 │     let make = (~someProp: array<int>) => {
  11 │       <Level2 someProp />
  12 │     }
  13 │ }

  This has type: array<int>
  But it's expected to have type: float

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