0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Typescriptバージョンを2.0にしたら、sublimeで_thisが重複のエラーのビルドエラー

0
Last updated at Posted at 2017-01-06

Typescriptバージョンアップしたら、_thisが重複のエラーのビルドエラーが発生
** error TS2400: Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.
2 **

1.8で問題ないですが、2.0にしたら、_this重複のエラーが出ています。
原因はアロー関数をかくと、thisを自動的に_thisに置換するそうです。(2.0から?)
[http://stackoverflow.com/questions/12710303/should-creating-a-variable-named-this-conflict-with-this]

とりあえず、Sublime設定のtypescript_tsdkを1.8に設定して、ビルドエラー出なくなりました。

そもそも_thisを使わないほうがいいですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?