facebook / facebook/flow

Multiple properties with the same name doesn't trigger an error

オープン
#967 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
linter
主要言語
Rust
スター
22.3k
フォーク
1.9k
PR マージ指標
30日以内にマージされた PR はありません

説明

This seems like a situation that Flow should give an error:

``` javascript
/* @flow */
//jshint ignore:start

class Foo {
a() {return 1}
a() {return 2}
}

var o = {
a: 5,
a: 6
};
```

If the multiple properties have different types, Flow does give an error at least:

``` javascript
/* @flow */
//jshint ignore:start

class Foo {
a(): number {return 1}
a(): string {return 'b'}
}
```

```
$ flow

/private/tmp/foo/index.js:5:23,23: number
This type is incompatible with
/private/tmp/foo/index.js:6:8,13: string

Found 1 error
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。