Merge pull request #372 from susliko/abstract-givens

Allow for abstract givens
pull/659/head
Vasil Markoukin 2024-01-18 19:07:11 +07:00 committed by GitHub
commit 0c63ada18d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 3 deletions

@ -1247,6 +1247,9 @@ object A:
given [A](using Foo[A]): Foo[List[A]] with
def x = ()
trait B:
given c: Context[T]
--------------------------------------------------------------------------------
(compilation_unit
@ -1385,7 +1388,16 @@ object A:
(with_template_body
(function_definition
(identifier)
(unit)))))))
(unit))))
(trait_definition
(identifier)
(template_body
(given_definition
(identifier)
(generic_type
(type_identifier)
(type_arguments
(type_identifier)))))))))
================================================================================
Top-level Definitions (Scala 3 syntax)

@ -595,8 +595,9 @@ module.exports = grammar({
field("return_type", $._structural_instance),
seq(
field("return_type", $._annotated_type),
"=",
field("body", $._indentable_expression),
optional(
seq("=", field("body", $._indentable_expression))
),
),
),
),