Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Commit 4549279

Browse files
committed
Rudimentary support for reflective calls
Added a `reflectiveProxies` field to `typeData`, this field contains an array of struct with `methodId` of `i32`, and a reference to a reflective proxy function. When the compiler found an Apply to the reflective proxy, we lookup the method to call from the `reflectiveProxies` field in the receiver's `typeData` field, instead of normal table dispatching.
1 parent 953adf2 commit 4549279

File tree

11 files changed

+781
-19
lines changed

11 files changed

+781
-19
lines changed

Diff for: build.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ lazy val `scalajs-test-suite` = project
183183

184184
(Test / sources).value
185185
.filterNot(endsWith(_, "/UnionTypeTest.scala")) // requires typechecking macros
186-
.filterNot(endsWith(_, "/compiler/DefaultMethodsTest.scala")) // reflective calls
187186
.filterNot(endsWith(_, "/compiler/ReflectiveCallTest.scala")) // reflective calls
188-
.filterNot(endsWith(_, "/compiler/WasPublicBeforeTyperTestScala2.scala")) // reflective calls
189187
.filterNot(endsWith(_, "/jsinterop/ExportsTest.scala")) // js.dynamicImport (multi-modules)
190188
},
191189

@@ -228,6 +226,8 @@ lazy val `scalajs-test-suite` = project
228226

229227
lazy val IgnoredTestNames: Set[String] = {
230228
Set(
229+
// reflective call: should be throw an exception when reflective proxy not found
230+
"org.scalajs.testsuite.compiler.WasPublicBeforeTyperTestScala2",
231231
// javaLangNumber failed: java.lang.AssertionError: 1, class java.lang.Number expected:<true> but was:<false>
232232
"org.scalajs.testsuite.compiler.RuntimeTypeTestsTest",
233233
// Various run-time errors and JS exceptions

0 commit comments

Comments
 (0)