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

scala.NotImplementedError: an implementation is missing when running scala-cli test . in a native project #2839

Open
spamegg1 opened this issue Apr 5, 2024 · 1 comment
Labels
Community help wanted Issues that idicate features that are nice-to-have but core team does not have time to work on it missing feature Something should have been implemented, but wasn't. Scala Native

Comments

@spamegg1
Copy link
Contributor

spamegg1 commented Apr 5, 2024

Version(s)

1.2.1

Describe the bug

scala.NotImplementedError: an implementation is missing when running scala-cli test . in a native file.

The stacktrace says:

scala.NotImplementedError: an implementation is missing
  scala.Predef$.$qmark$qmark$qmark(Predef.scala:344)
  scala.build.testrunner.AsmTestRunner$.matchFingerprints$$anonfun$1(AsmTestRunner.scala:92)
  scala.collection.IterableOnceOps.find(IterableOnce.scala:678)
  scala.collection.IterableOnceOps.find$(IterableOnce.scala:674)
  scala.collection.AbstractIterable.find(Iterable.scala:935)
  scala.build.testrunner.AsmTestRunner$.matchFingerprints(AsmTestRunner.scala:93)
  scala.build.testrunner.AsmTestRunner$.taskDefs$$anonfun$1(AsmTestRunner.scala:305)
...

so I believe it's coming from here

To Reproduce

With only one file HelloNative.scala:

//> using scala 3.4.1
//> using platform native
//> using nativeVersion 0.5.0-RC3

import scalanative.unsafe.CQuote
import scalanative.libc.stdio

@main
def helloNative: Unit =
  stdio.printf(c"hello native %s!\n", c"world")

run scala-cli test . in the same directory.

Expected behaviour

Should finish OK.

@spamegg1 spamegg1 added the bug Something isn't working label Apr 5, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Apr 8, 2024

It seems the culprit is right around here:

case _: AnnotatedFingerprint =>
// val annotationCls = loader.loadClass(f.annotationName())
// .asInstanceOf[Class[Annotation]]
// f.isModule == isModule && (
// cls.isAnnotationPresent(annotationCls) ||
// cls.getDeclaredMethods.exists(_.isAnnotationPresent(annotationCls)) ||
// cls.getMethods.exists(m => m.isAnnotationPresent(annotationCls) && Modifier.isPublic(m.getModifiers()))
// )
???

So this is indeed a missing feature in Scala CLI.

@Gedochao Gedochao added Community help wanted Issues that idicate features that are nice-to-have but core team does not have time to work on it missing feature Something should have been implemented, but wasn't. Scala Native and removed bug Something isn't working labels Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community help wanted Issues that idicate features that are nice-to-have but core team does not have time to work on it missing feature Something should have been implemented, but wasn't. Scala Native
Projects
None yet
Development

No branches or pull requests

2 participants