-Xlint

2016-06-25 5 views
3

scalax -Xlintヘルプには、以下の情報を提供しますか? scalac -Xlintの意味は何ですか?すべてを有効にしますか?デフォルトセット(?)?何もしないだろうか?-Xlint

注:スカラ座2.11.8と0.13.9 SBT

新しいバージョンは、それらを更新して異なる動作/機能は、私に知らせて提供した場合、問題

+1

はい、 '-Xlint'はそれらをすべて有効にします。 'scala -e'を使って自分で確認し、警告メッセージを見ることができます。例えば、' scala -Xlint -e 'print( "foo $ {1}") '' – 4e6

答えて

5

-Xlintcurrently means-Xlint:_ないが、しかしそれはto be made explicitを必要とします。

これまで、デフォルトで有効にするにはノイズが多く、信頼性が低いという警告が常にありました。そのため、警告は常に-Xlintから除外されています。

現在、one such lintableがありますが、コマンドラインオプションには接続されていません。

-Ywarn-allは、以前は-Xlintに加えて他の警告を加えたものでした。なぜオプションがなくなったのかは明らかではありません。

ある時点で、-Xlint:_が推奨サブセットを意味する-Xlintで、-Ywarn-allを意味するつもりだったが、それはそれは任意に多くを有効にする場合行うことが困難である、人々は-Xlint:-annoying,_と1つのまたは2糸くずのルールを無効にすることが判明他の騒々しい糸くずのルール。

通常、scalac -Xはデフォルトを示します。おそらくscalac -Xlint:helpがデフォルトの動作を示すように改善されます。そのデフォルトは-Yoptのようなものにとっては重要ではありません。

$ scalac -help 
Usage: scalac <options> <source files> 
where possible standard options include: 
    -X        Print a synopsis of advanced options. 


$ scalac -X 
Usage: scalac <options> <source files> 

-- Notes on option parsing -- 
Boolean settings are always false unless set. 
Where multiple values are accepted, they should be comma-separated. 
    example: -Xplugin:option1,option2 
<phases> means one or a comma-separated list of: 
    (partial) phase names, phase ids, phase id ranges, or the string "all". 
    example: -Xprint:all prints all phases. 
    example: -Xprint:expl,24-26 prints phases explicitouter, closelim, dce, jvm. 
    example: -Xprint:-4 prints only the phases up to typer. 

Possible advanced options include: 
    -Xlint:<_,warning,-warning> Enable or disable specific warnings: `_' for all, `-Xlint:help' to list 
関連する問題