codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

const and let in switch not defined #174

Closed Radivarig closed 7 years ago

Radivarig commented 7 years ago

When using const/let and typecheck in variable declaration I get:
Uncaught ReferenceError: n is not defined it works with var tho.

switch (..)
  {
    case '..':
      // breaks
      const n: number = 3  // const
      let n2: number = 3  // let
      // works
      var n3: number = 3  // var, works
      // no typecheck
      const n4 = 3  
      let n5 = 3
      ..
phpnode commented 7 years ago

Hi, sorry for taking so long to respond to this, this project is now deprecated in favour of https://codemix.github.io/flow-runtime which aims for full compatibility with Flow.

I checked and babel-plugin-flow-runtime does not have this particular bug.