Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Warning for 'false' equals true #60

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

erikvanoosten commented Mar 25, 2013

Warn that 'false' is interpreted as true when it is used as a boolean literal. See also #13.

@sprsquish sprsquish commented on the diff Jun 12, 2013

...scala/com/twitter/scrooge/frontend/ThriftParser.scala
@@ -185,6 +185,10 @@ class ThriftParser(importer: Importer, strict: Boolean) extends RegexParsers {
val transformedVal = ftype match {
case TBool => value map {
case IntLiteral(0) => BoolLiteral(false)
+ case IdRHS(SimpleID("false")) => {
+ System.err.println("WARNING: according to Apache Thrift 'false' will translate to a true value, use '0' if you really meant false")
@sprsquish

sprsquish Jun 12, 2013

Contributor

This should use failOrWarn

Contributor

nshkrob commented Jul 22, 2015

Boolean constants handling was fixed in e9d2508.

@nshkrob nshkrob closed this Jul 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment