diff --git a/blink/internal/fixer/rules/gen3_class_sep.go b/blink/internal/fixer/rules/gen3_class_sep.go index d0dccf6771..e954b706df 100644 --- a/blink/internal/fixer/rules/gen3_class_sep.go +++ b/blink/internal/fixer/rules/gen3_class_sep.go @@ -224,9 +224,9 @@ func classSepMemberType(s *tokens.Stream, m int) int { return sepMethod case "case": return sepCase - default: - return sepUnknown } + // otherwise a keyword type ("array", "int", "string", ...) opens a typed + // property; fall through to the variable scan below } for x := k; x <= end; x++ { t := s.At(x) diff --git a/blink/internal/fixer/rules/gen3_class_sep_test.go b/blink/internal/fixer/rules/gen3_class_sep_test.go index 96ed4ba5cc..c6144e6f03 100644 --- a/blink/internal/fixer/rules/gen3_class_sep_test.go +++ b/blink/internal/fixer/rules/gen3_class_sep_test.go @@ -26,6 +26,24 @@ func TestGen3ClassSepMethods(t *testing.T) { } } +func TestGen3ClassSepKeywordTypedProperty(t *testing.T) { + // a property typed with a keyword type ("array") is still a property and must + // be separated from the previous member by a blank line + src := "