From f4451cf97116588db41791227ef86a71afe6ae11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Wed, 15 Dec 2021 23:55:56 +0100 Subject: [PATCH] Apparently a `String & js.Object` type breaks scala 3. Let's call that a `String` --- .../converter/internal/importer/ImportType.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala index 0c6a6a3bf0..fbb11ea049 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala @@ -207,7 +207,14 @@ class ImportType(stdNames: QualifiedName.StdNames) { TypeRef.Union(imported, NoComments, sort = false) case TsTypeIntersect(types) => - TypeRef.Intersection(types.map(apply(scope, importName)), NoComments) + types.map(apply(scope, importName)) match { + case stringObject + if stringObject.length == 2 && stringObject.contains(TypeRef.String) && stringObject.contains( + TypeRef.JsObject, + ) => + TypeRef.String + case other => TypeRef.Intersection(other, NoComments) + } case TsTypeConstructor(_, TsTypeFunction(sig)) => newableFunction(scope, importName, sig, NoComments)