// checkQuestionForDuplicateLabels checks if there are multiple questions with the same label, and if so, adds an warning to the typechecker func checkQuestionForDuplicateLabels(question interfaces.Question, typeChecker interfaces.TypeChecker) { labelKnown := typeChecker.IsLabelUsed(question.Label()) if labelKnown { typeChecker.AddEncounteredWarning(errors.NewDuplicateLabelWarning(question, typeChecker.VarIDForLabel(question.Label()))) return } typeChecker.MarkLabelAsUsed(question.Label(), question.VarDecl()) }