GitXplorerGitXplorer
l

Flow-Reproduce-Issue

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
a82326606e831112cd4aab8a085054210cace036

Fixing typo

committed 8 years ago
Unverified
1364f062118909286fcaf1c8eabd646b4890583a

Updating README

committed 8 years ago
Unverified
abce960eee856fde5278f20e065c25d010a2e22a

Adding files to reproduce bug

committed 8 years ago
Unverified
cb6ae90a61e33c613ff3851969a7820207004c25

Initial commit

committed 8 years ago

README

The README file for this repository.

Flow-Reproduce-Issue

Repo to reproduce Flow issue.

The following program:

type obj = {
  a : number,
  b : number
}
type ty = {
  c : ?obj
}

function test(x : ty){
  if(x.c == null){
    throw new Error('Erorr!')
  }
  var temp = x.c.a;
  console.log('test')
  return x.c.b;
}

produces the following errors:

index.js:17
 17:   return x.c.b;
                  ^ property `b`. Property cannot be accessed on possibly null value
 17:   return x.c.b;
              ^^^ null

index.js:17
 17:   return x.c.b;
                  ^ property `b`. Property cannot be accessed on possibly undefined value
 17:   return x.c.b;
              ^^^ undefined

Removing the console.log eliminates the error. Also, x.c will definitely not be null given the thrown exception is in the then branch of the if statement.