5

enter image description here After installing scala plugin on intellij I began to have this weird error with 'Can't resolve symbol' message.

It appears while using scala tuples inside my java code.

This error doesn't prevent me from building/running successfully but I can't get rid of them and it confuses me a lot.

I believe this is a bug in the intellij itself.

The code

import scala.Tuple2;


public class testTuple2 {

public static void main(String[] args) {

//this line show errors
Tuple2<Integer, Integer> tuple = new Tuple2<Integer, Integer>(3, 4);

System.out.println("Tuple 1" + tuple._1);

//this line doesn't show errors
System.out.println("Tuple 1" + tuple._1()); 

 }
}

pom file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0       http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.test</groupId>
<artifactId>com.test</artifactId>
<version>1.0-SNAPSHOTcom.test</version>
<dependencies>
    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>2.10.4</version>
    </dependency>
</dependencies>

Some facts :

  • I use maven as a build tool
  • The same code works well on eclipse
  • Intellij (Ultimate) version is 14.1.5 on Ubuntu 14.04 LTS
  • Scala Plugin version is 1.5.4
  • Project SDK version is 1.8.0_60

My trials

I tried invalidating the cache and restarting idea but in vain I tried removing/disabling the plugin and it worked but I need the plugin for my scala projects so this isnt a valid solution for me. I tried updating intellij to the latest version and the scala plugin but in vain

Ahmed Kamal
  • 1,478
  • 14
  • 27
  • 2
    This was a bug in Scala plugin. If you turn it off, everything will be fine. This bug is fixed now, so if you update your plugin, everything should work fine. [Bug report](https://youtrack.jetbrains.com/issue/SCL-7948) – ilinum Dec 30 '15 at 07:37

0 Answers0