Groovy mistakenly using constructor of enclosing class?
问题 Given: static class Question { // stuff List<Value> values static class Value { // stuff } When I run: Question question = new Question() question.id = "whatever" if (it == QuestionType.SELECT || it == QuestionType.MULTICHOICE) { question.values = [new Question.Value(), new Question.Value()] for (Question.Value v : question.values) { // stuff } question.values contains an array of Question objects and NOT Value. Intellij doesn't give me any error nor warnings. I tried evaluating "new Question