Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.
/ babylon Public archive
This repository was archived by the owner on May 19, 2018. It is now read-only.

Syntax error for overwriting constructor type in flow class #508

@philipp-spiess

Description

@philipp-spiess

In a recent version change, parsing flow files introduced an error when a flow class overwrites the constructor type.

Input Code

class Foo {
  constructor: () => this;
}

Babylon/Babel Configuration

{
  "plugins": [
     "transform-class-properties",
      "transform-object-rest-spread"
   ],
   "presets": ["latest", "react"]
}

Expected Behavior

The file parses correctly. Flow parser accepts the syntax properly

Current Behavior

error  Parsing error: Classes may not have a non-static field named 'constructor'

Your Environment

software version
Babylon 6.17.0 (worked in 6.16.1)
node v6.9.1
npm 3.10.8
Operating System macOS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions