Skip to content

Commit

Permalink
SIP-64 Context bounds for type members
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Dec 12, 2024
1 parent 6c5e7d2 commit 9e1671f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ module.exports = grammar({
field("type_parameters", optional($.type_parameters)),
field("bound", optional($.lower_bound)),
field("bound", optional($.upper_bound)),
field("bound", optional($._context_bounds)),
),
),

Expand Down
19 changes: 19 additions & 0 deletions test/corpus/definitions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,25 @@ class A {
(type_parameters
(identifier))))))

================================================================================
Type definitions (Scala 3 syntax)
================================================================================

class A:
type Element: Order

--------------------------------------------------------------------------------

(compilation_unit
(class_definition
(identifier)
(template_body
(type_definition
(type_identifier)
(context_bound
(type_identifier))))))


================================================================================
Function declarations
================================================================================
Expand Down

0 comments on commit 9e1671f

Please sign in to comment.