Skip to content

Commit

Permalink
Be a bit more flexible and accept when a type parameter is not provided.
Browse files Browse the repository at this point in the history
This is obviously not a good sign, but it does come up with mismatched versions. It's also hard to debug, and the value of breaking the conversion is at least very low

Fixes issue raised in ScalablyTyped/ScalaJsReactDemos#8
  • Loading branch information
oyvindberg committed Mar 18, 2021
1 parent 92357fb commit a4273b1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ object FillInTParams {
case (TsTypeParam(_, expected, _, default), idx) =>
val provided =
if (providedTParams.lengthCompare(idx) > 0) providedTParams(idx)
else default.getOrElse(sys.error("Type parameter not provided"))
else
default.getOrElse(
TsTypeRef.any.copy(comments = Comments(Comment.warning(s"${expected.value} not provided"))),
)

TsTypeRef(expected) -> provided
}.toMap
Expand Down

0 comments on commit a4273b1

Please sign in to comment.