permanently hidden warning in scala application

后端 未结 10 2188
臣服心动
臣服心动 2021-01-31 14:25

I get the following warning whenever I start my Scala application:

WARN - imported `SVNProperties\' is permanently hidden by definition of object SVNProperties in packag

10条回答
  •  猫巷女王i
    2021-01-31 15:09

    Just to further expand on a comment posted by Nick, as this was the case for me:

    Another common cause is that SVNProperties is in the same package and so is already in scope. Trying to import it explicitly results in this warning.

    More concretely, you may have:

    package app.core
    
    // No need to import the following - it is already visible as 
    // you are in the same package
    import app.core.SVNProperties
    
    object SVNResource {
    

    Use instead:

    package app.core
    
    object SVNResource {
    

    (Opinion) As a matter of coding style you may want to camel case your variables differently like for eg. SvnProperties, SvnResource. It reads easier for most people, see also this question.

提交回复
热议问题