Overriding Schema.create whilst using -Xfatal-warnings

14 views
Skip to first unread message

Peter Leong

unread,
Mar 30, 2017, 11:39:01 PM3/30/17
to Squeryl
Hi,

I want to automatically create a record in a table upon schema creation.  Unfortunately I also use "-Xfatal-warnings" and overriding "Schema.create" causes a "side-effecting nullary methods are discouraged" warning, which fails my compile.

Has anyone encountered this problem and found a good workaround?  Alternatively, maybe 'Schema.createSchema()' could be added which would be called by 'create'?

Thanks in advance,
Pete

Peter Leong

unread,
Mar 30, 2017, 11:58:14 PM3/30/17
to Squeryl
Ugh... it's always the way.  Extensive search fails => Ask for help => Immediately find solution.

A post on scala-user mailing list has solved the problem with '-Xlint:-nullary-unit'.

In case anyone else is using maven, this is the pom.xml snippet:
<plugin>
   
<groupId>net.alchim31.maven</groupId>
   
<artifactId>scala-maven-plugin</artifactId>
    ...
   
<configuration>
        ...
       
<args>
           
<arg>-Xfatal-warnings</arg>
           
<arg>-deprecation</arg>
           
<arg>-Xlint:-nullary-unit</arg>
            ...



Cheers,
Pete
Reply all
Reply to author
Forward
0 new messages