Skip to content

Parse native in Java bytecode as @native #16232

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

Merged
merged 2 commits into from
Oct 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ class ClassfileParser(
def complete(denot: SymDenotation)(using Context): Unit = {
val sym = denot.symbol
val isEnum = (jflags & JAVA_ACC_ENUM) != 0
val isNative = (jflags & JAVA_ACC_NATIVE) != 0
val isConstructor = name eq nme.CONSTRUCTOR

/** Strip leading outer param from constructor and trailing access tag for
Expand Down Expand Up @@ -313,6 +314,10 @@ class ClassfileParser(
val isVarargs = denot.is(Flags.Method) && (jflags & JAVA_ACC_VARARGS) != 0
denot.info = sigToType(sig, isVarargs = isVarargs)
if (isConstructor) normalizeConstructorParams()
if isNative then
attrCompleter.annotations ::= Annotation.deferredSymAndTree(defn.NativeAnnot) {
New(defn.NativeAnnot.typeRef, Nil)
}
denot.info = translateTempPoly(attrCompleter.complete(denot.info, isVarargs))
if (isConstructor) normalizeConstructorInfo()

Expand Down