Skip to content

Unable to parse Java raw types #3028

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

Closed
julienrf opened this issue Aug 28, 2017 · 1 comment
Closed

Unable to parse Java raw types #3028

julienrf opened this issue Aug 28, 2017 · 1 comment

Comments

@julienrf
Copy link
Contributor

julienrf commented Aug 28, 2017

The following Java code is parsed and compiled by javac but dotc rejects it:

abstract class INodeBase<K, V> extends BasicNode {
    @SuppressWarnings("rawtypes")
    public static final AtomicReferenceFieldUpdater<INodeBase, MainNode> updater =
            AtomicReferenceFieldUpdater.newUpdater(INodeBase.class, MainNode.class, "mainnode");
}

The errors produced by dotc are the following:

[error] -- Error: /home/julien/workspace/dev/scala/collection-strawman/src/main/scala/strawman/collection/concurrent/INodeBase.java:18:52 
[error] 18 |    public static final AtomicReferenceFieldUpdater<INodeBase, MainNode> updater =
[error]    |                                                    ^^^^^^^^^
[error]    |Type argument strawman.collection.concurrent.INodeBase has not the same kind as its bound 
[error] -- Error: /home/julien/workspace/dev/scala/collection-strawman/src/main/scala/strawman/collection/concurrent/INodeBase.java:18:63 
[error] 18 |    public static final AtomicReferenceFieldUpdater<INodeBase, MainNode> updater =
[error]    |                                                               ^^^^^^^^
[error]    |Type argument strawman.collection.concurrent.MainNode has not the same kind as its bound 

The full code is available here.

@julienrf
Copy link
Contributor Author

I’m closing the issue because the code provided in the description now compiles. I can create a PR that adds a test, if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants