We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When calling a method of Java class in Spring Security library, Scala code failed to compile.
I saw similar errors when searching error message in this project, but it seems all problem got fixed in earlier version.
3.0.1
import org.springframework.security.config.annotation.web.builders.HttpSecurity object TestCyclicReference: def securityFilter(http: HttpSecurity) = http.authorizeRequests
The above code need dependency org.springframework.security:spring-security-config:5.5.2 to compile.
TestCyclicReference.scala:4:44 Cyclic reference involving class AbstractInterceptUrlRegistry [4:44]
The code at error position: http.authorizeRequests
http.authorizeRequests
The code should be compiled successful
The text was updated successfully, but these errors were encountered:
Self-contained:
Configurer.java
abstract class AbstractConfigurer { abstract class AbstractRegistry<R extends AbstractRegistry<R>> {} } public final class Configurer extends AbstractConfigurer { public final class Registry extends AbstractRegistry<Registry> {} public Registry registry() { return null; } }
Test.scala
object Test: def registry(cfg: Configurer) = cfg.registry
$ javac -version && scalac -3.head -version javac 1.8.0_292 Scala compiler version 3.1.0-RC1-bin-20210818-868906d-NIGHTLY-git-868906d -- Copyright 2002-2021, LAMP/EPFL $ javac Configurer.java $ scalac -3.head Test.scala exception caught when loading class AbstractRegistry: Cyclic reference involving class AbstractRegistry exception caught when loading class Registry: Cyclic reference involving class AbstractRegistry -- [E046] Cyclic Error: Test.scala:2:34 ---------------------------------------- 2 | def registry(cfg: Configurer) = cfg.registry | ^ | Cyclic reference involving class AbstractRegistry
Sorry, something went wrong.
Avoid cycle with F-bounded inner Java class
46585c4
Fixes scala#13336.
f1336d6
smarter
Successfully merging a pull request may close this issue.
When calling a method of Java class in Spring Security library, Scala code failed to compile.
I saw similar errors when searching error message in this project, but it seems all problem got fixed in earlier version.
Compiler version
3.0.1
Minimized code
The above code need dependency org.springframework.security:spring-security-config:5.5.2 to compile.
Output
The code at error position:
http.authorizeRequests
Expectation
The code should be compiled successful
The text was updated successfully, but these errors were encountered: