Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failed: class type required but T found #467

Closed
steinybot opened this issue Aug 2, 2022 · 1 comment · Fixed by #475
Closed

Compilation failed: class type required but T found #467

steinybot opened this issue Aug 2, 2022 · 1 comment · Fixed by #475

Comments

@steinybot
Copy link
Contributor

Reproduction: https://github.com/steinybot/bug-reports/tree/scalablytyped/rc-tree

project/plugins.sbt:

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta39")

build.sbt:

scalaVersion := "2.13.8"

enablePlugins(ScalaJSPlugin, ScalablyTypedConverterPlugin)

scalaJSUseMainModuleInitializer := true

Compile / npmDependencies ++= Seq(
  "rc-tree" -> "5.6.6"
)

Running sbt stImport fails with:

[error] ZincCompiler.scala:230 msg.get() [Error] /Users/jason/src/bug-reports/target/streams/_global/stImport/_global/streams/sources/r/rc-tree/src/main/scala/typings/rcTree/interfaceMod.scala:406: class type required but T found [project => bug-reports, ms => 11128]
[error] ZincCompiler.scala:230 msg.get() one error found [project => bug-reports, ms => 11329]
[error] Phase3Compile.scala:147 err Compilation failed: -Xplugin:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-compiler_2.13.8/1.10.1/scalajs-compiler_2.13.8-1.10.1.jar, -encoding, utf-8, -feature, -g:notailcalls, -language:implicitConversions, -language:higherKinds, -language:existentials, -bootclasspath, /Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.8/scala-library-2.13.8.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.8/scala-library-2.13.8.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.8/scala-library-2.13.8.jar, -classpath, /Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.8/scala-compiler-2.13.8.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.8/scala-reflect-2.13.8.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.21.0/jline-3.21.0.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.9.0/jna-5.9.0.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-library_2.13/1.10.1/scalajs-library_2.13-1.10.1.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-compiler_2.13.8/1.10.1/scalajs-compiler_2.13.8-1.10.1.jar:/Users/jason/.ivy2/local/org.scalablytyped/rc-virtual-list_sjs1_2.13/3.4.8-23ea56/jars/rc-virtual-list_sjs1_2.13.jar:/Users/jason/.ivy2/local/org.scalablytyped/std_sjs1_2.13/4.3-b346df/jars/std_sjs1_2.13.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-dom_sjs1_2.13/2.2.0/scalajs-dom_sjs1_2.13-2.2.0.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-library_2.13/1.5.1/scalajs-library_2.13-1.5.1.jar:/Users/jason/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/olvind/scalablytyped-runtime_sjs1_2.13/2.4.2/scalablytyped-runtime_sjs1_2.13-2.4.2.jar [Error] /Users/jason/src/bug-reports/target/streams/_global/stImport/_global/streams/sources/r/rc-tree/src/main/scala/typings/rcTree/interfaceMod.scala:406: class type required but T found [thread => 281, project => bug-reports, ms => 11382, phase => build, id => rc-tree, flavour => NormalFlavour]

That line of interfaceMod.scala looks like:

   /* import warning: RemoveDifficultInheritance.summarizeChanges 
  - Dropped {[ P in keyof std.Record<ChildFieldName, std.Array<rc-tree.rc-tree/es/interface.FieldDataNode<T, ChildFieldName>>> ]:? std.Record<ChildFieldName, std.Array<rc-tree.rc-tree/es/interface.FieldDataNode<T, ChildFieldName>>>[P]} */ @js.native
  trait FieldDataNode[T, ChildFieldName /* <: String */]
    extends StObject
       with BasicDataNode
       with T
@steinybot
Copy link
Contributor Author

Same thing happens updating antd to 4.22.3 in https://github.com/ScalablyTyped/SlinkyDemos

oyvindberg added a commit that referenced this issue Sep 19, 2022
…one of the parts of the intersection is a type parameter. Fixes #467
oyvindberg added a commit that referenced this issue Sep 19, 2022
…one of the parts of the intersection is a type parameter. Fixes #467 (#475)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant