diff --git a/corpus/definitions.txt b/corpus/definitions.txt index 980601cd0..a1f773f81 100644 --- a/corpus/definitions.txt +++ b/corpus/definitions.txt @@ -739,6 +739,8 @@ Type definitions class A { type B = C type D[E] = F + type Abs + type Beta[B] } --- @@ -753,7 +755,13 @@ class A { (type_definition (type_identifier) (type_parameters (identifier)) - (type_identifier))))) + (type_identifier)) + (type_definition + (type_identifier)) + (type_definition + (type_identifier) + (type_parameters + (identifier)))))) ======================================= Function declarations diff --git a/grammar.js b/grammar.js index 996dbac50..0f5c02f23 100644 --- a/grammar.js +++ b/grammar.js @@ -451,8 +451,11 @@ module.exports = grammar({ optional($.opaque_modifier), 'type', $._type_constructor, - '=', - field('type', $._type) + optional( + seq( + '=', + field('type', $._type)) + ) )), // Created for memory-usage optimization during codegen. diff --git a/script/smoke_test.sh b/script/smoke_test.sh index 0d4a0be36..bdf172194 100755 --- a/script/smoke_test.sh +++ b/script/smoke_test.sh @@ -3,7 +3,7 @@ # This is an integration test to generally check the quality of parsing. SCALA_SCALA_LIBRARY_EXPECTED=100 -SCALA_SCALA_COMPILER_EXPECTED=67 +SCALA_SCALA_COMPILER_EXPECTED=68 DOTTY_COMPILER_EXPECTED=65 if [ ! -d "$SCALA_SCALA_DIR" ]; then