fix: detect non boolean condition for IF and FOR statements

This commit is contained in:
Marc Vertes
2019-11-26 00:08:05 +01:00
committed by Traefiker Bot
parent d44e4af527
commit eef59153d8
5 changed files with 73 additions and 5 deletions

View File

@@ -935,6 +935,8 @@ func isInterface(t *itype) bool {
func isStruct(t *itype) bool { return t.TypeOf().Kind() == reflect.Struct }
func isBool(t *itype) bool { return t.TypeOf().Kind() == reflect.Bool }
func isInt(t reflect.Type) bool {
switch t.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: