Skip to content

Commit

Permalink
merge: #4039
Browse files Browse the repository at this point in the history
4039: bug(web): fix connection annotations r=adamhjk a=adamhjk

We weren't parsing connection annotations correctly (we had all the logic, we just weren't calling it.)

This fixes that.

Co-authored-by: Adam Jacob <[email protected]>
  • Loading branch information
si-bors-ng[bot] and adamhjk authored Jun 25, 2024
2 parents 51a2857 + 42e47ca commit ed2133a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ts-lib/src/connection-annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ export function connectionAnnotationFitsReference(
{ tokens: targetCa }: ConnectionAnnotation,
{ tokens: referenceCa }: ConnectionAnnotation,
) {
// If the length is longer than 1, we assume you have already parsed the
// connection annotations. Otherwise, we need to parse them.
if (targetCa.length === 1) {
// @ts-ignore
targetCa = parseConnectionAnnotation(targetCa[0]);
}
if (referenceCa.length === 1) {
// @ts-ignore
referenceCa = parseConnectionAnnotation(referenceCa[0]);
}
// a fitting target annotation is either the same as the reference one or a supertype thereof
const lowerTargetCa = _.map(targetCa, (a) => a.toLowerCase());
const lowerReferenceCa = _.map(referenceCa, (a) => a.toLowerCase());
Expand Down

0 comments on commit ed2133a

Please sign in to comment.