Generate runtime conversion diagnostics
Instead of inserting a comment with error description into the generated code, generate a call to a function that will print out a conversion error when executed. Do not print generic "partially converted" message anymore. Remove --verbose and --no_warnings options. Bug: 204062171 Test: internal Change-Id: Ib126e16dc76f49635e4939e670922f2561781049
This commit is contained in:
@@ -228,10 +228,9 @@ func (pv predefinedVariable) emitSet(gctx *generationContext, asgn *assignmentNo
|
||||
if actualValue == expectedValue {
|
||||
return
|
||||
}
|
||||
gctx.writef("# MK2RBC TRANSLATION ERROR: cannot set predefined variable %s to %q, its value should be %q",
|
||||
pv.name(), actualValue, expectedValue)
|
||||
gctx.newLine()
|
||||
gctx.write("pass")
|
||||
gctx.emitConversionError(asgn.location,
|
||||
fmt.Sprintf("cannot set predefined variable %s to %q, its value should be %q",
|
||||
pv.name(), actualValue, expectedValue))
|
||||
gctx.starScript.hasErrors = true
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user