Skip to content

Commit cb34635

Browse files
committed
Abstract type definitions
1 parent f7b8336 commit cb34635

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

corpus/definitions.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ Type definitions
739739
class A {
740740
type B = C
741741
type D[E] = F
742+
type Abs
743+
type Beta[B]
742744
}
743745

744746
---
@@ -753,7 +755,13 @@ class A {
753755
(type_definition
754756
(type_identifier)
755757
(type_parameters (identifier))
756-
(type_identifier)))))
758+
(type_identifier))
759+
(type_definition
760+
(type_identifier))
761+
(type_definition
762+
(type_identifier)
763+
(type_parameters
764+
(identifier))))))
757765

758766
=======================================
759767
Function declarations

grammar.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,11 @@ module.exports = grammar({
451451
optional($.opaque_modifier),
452452
'type',
453453
$._type_constructor,
454-
'=',
455-
field('type', $._type)
454+
optional(
455+
seq(
456+
'=',
457+
field('type', $._type))
458+
)
456459
)),
457460

458461
// Created for memory-usage optimization during codegen.

script/smoke_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This is an integration test to generally check the quality of parsing.
44

55
SCALA_SCALA_LIBRARY_EXPECTED=100
6-
SCALA_SCALA_COMPILER_EXPECTED=67
6+
SCALA_SCALA_COMPILER_EXPECTED=68
77
DOTTY_COMPILER_EXPECTED=65
88

99
if [ ! -d "$SCALA_SCALA_DIR" ]; then

0 commit comments

Comments
 (0)