Skip to content

Commit

Permalink
Add ApplyUsingTree that represents context parameter application
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishiking committed Sep 5, 2021
1 parent 6e53ddd commit bf2f5f7
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/semanticdb/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ message Tree {
OriginalTree original_tree = 6;
SelectTree select_tree = 7;
TypeApplyTree type_apply_tree = 8;
ApllyUsingTree apply_using_tree = 9;
}
}
```
Expand Down Expand Up @@ -1123,6 +1124,15 @@ message TypeApplyTree {
A `TypeApplyTree` represents the type application of a method, providing that
method with type arguments.

```protobuf
message ApplyUsingTree {
Tree function = 1;
repeated Tree arguments = 2;
}
```

An `ApplyUsingTree` represents a method application whose arguments are context parameters.

## Data Schemas

### Protobuf
Expand Down Expand Up @@ -2833,6 +2843,39 @@ orig(scala.concurrent.Future.successful(1)).flatMap[Int]({ (a) =>
})(global)
```

</td>
</tr>

<tr>

<td valign="top" rowspan="2">

Context parameters application

</td>
<td>

```scala
def max[T](
x: T,
y: T
)(using ord: Ord[T]) = ???
max(1, 2)
```

</td>
<td>

```scala
Synthetic(
<max(1, 2)>,
ApplyUsingTree(
OriginalTree(<max(1, 2)>),
List(
IdTree(<intOrd>),
)))
```

</td>
<tr>

Expand Down
6 changes: 6 additions & 0 deletions semanticdb/semanticdb/semanticdb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ message Tree {
OriginalTree original_tree = 6;
SelectTree select_tree = 7;
TypeApplyTree type_apply_tree = 8;
ApplyUsingTree apply_using_tree = 9;
}
}

Expand Down Expand Up @@ -419,3 +420,8 @@ message TypeApplyTree {
Tree function = 1;
repeated Type type_arguments = 2;
}

message ApplyUsingTree {
Tree function = 1;
repeated Tree arguments = 2;
}

0 comments on commit bf2f5f7

Please sign in to comment.