Skip to content

"has weaker access privileges; it should be public" error when compiling against jOOQ #18654

Closed
@tpunder

Description

@tpunder

Compiler version

Scala 3.3.1

Minimized code

See: https://github.com/tpunder/scala3_jooq_bug_access_privileges

The only Scala source file is:

package com.example

import org.jooq.impl.AbstractRoutine

// Works in Scala 2.12 and 2.13 but is broken in Scala 3
class MyRoutineScala extends AbstractRoutine[String] {

}

The equivalent Java source compiles file:

package com.example;

import org.jooq.impl.AbstractRoutine;

// Works fine
class MyRoutineJava extends AbstractRoutine<String> {

}

Output

[info] Setting Scala version to 3.3.1 on 1 projects.
[info] Reapplying settings...
[info] set current project to scala3_jooq_bug_access_privileges (in build file:/Users/tim/code/personal/scala3_jooq_bug_access_privileges/)
[info] compiling 1 Scala source and 6 Java sources to /Users/tim/code/personal/scala3_jooq_bug_access_privileges/target/scala-3.3.1/classes ...
[error] -- [E164] Declaration Error: /Users/tim/code/personal/scala3_jooq_bug_access_privileges/src/main/scala/com/example/MyRoutineScala.scala:6:6
[error] 6 |class MyRoutineScala extends AbstractRoutine[String] {
[error]   |      ^
[error]   |error overriding method configuration in trait Attachable of type (): org.jooq.Configuration;
[error]   |  method configuration in class AbstractQueryPart of type (): org.jooq.Configuration has weaker access privileges; it should be public
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 2 s, completed Oct 5, 2023, 2:11:58 PM

Expectation

The code works fine under Scala 2.12 and 2.13:

[info] Setting Scala version to 2.12.18 on 1 projects.
[info] Reapplying settings...
[info] set current project to scala3_jooq_bug_access_privileges (in build file:/Users/tim/code/personal/scala3_jooq_bug_access_privileges/)
[info] compiling 1 Scala source to /Users/tim/code/personal/scala3_jooq_bug_access_privileges/target/scala-2.12/classes ...
[success] Total time: 1 s, completed Oct 5, 2023, 2:11:55 PM
[info] Setting Scala version to 2.13.10 on 1 projects.
[info] Reapplying settings...
[info] set current project to scala3_jooq_bug_access_privileges (in build file:/Users/tim/code/personal/scala3_jooq_bug_access_privileges/)
[info] compiling 1 Scala source to /Users/tim/code/personal/scala3_jooq_bug_access_privileges/target/scala-2.13/classes ...
[success] Total time: 1 s, completed Oct 5, 2023, 2:11:56 PM

There is a similar jOOQ related bug here: #16844

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions