Skip to content
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

Address Xlint:unchecked? #260

Open
ice1000 opened this issue Sep 24, 2020 · 1 comment
Open

Address Xlint:unchecked? #260

ice1000 opened this issue Sep 24, 2020 · 1 comment
Labels

Comments

@ice1000
Copy link
Contributor

ice1000 commented Sep 24, 2020

arend>gradlew classes

> Task :base:compileJava
arend\base\src\main\java\org\arend\extImpl\userData\UserDataHolderImpl.java:18: warning: [uncheck
ed] unchecked cast
    return myUserDataMap == null ? null : (T) myUserDataMap.get(key);
                                                               ^
  required: T
  found:    Object
  where T is a type-variable:
    T extends Object declared in method <T>getUserData(@org.jetbrains.annotations.NotNull Key<T>)
arend\base\src\main\java\org\arend\typechecking\visitor\CheckTypeVisitor.java:401: warning: [unch
ecked] unchecked cast
      return result == null ? null : (List<CorePattern>) (List<?>) result.getPatterns();
                                                         ^
  required: List<CorePattern>
  found:    List<CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
arend\base\src\main\java\org\arend\core\pattern\ConstructorExpressionPattern.java:58: warning: [u
nchecked] unchecked cast
    return (List<? extends ExpressionPattern>) super.getSubPatterns();
                                                                   ^
  required: List<? extends ExpressionPattern>
  found:    @org.jetbrains.annotations.NotNull List<CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Pattern from capture of ? extends Pattern
arend\base\src\main\java\org\arend\core\pattern\ConstructorExpressionPattern.java:87: warning: [u
nchecked] unchecked cast
      link = pattern.replaceBindings(link, (List<Pattern>) (List<?>) subPatterns);
                                                           ^
  required: List<Pattern>
  found:    List<CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
arend\base\src\main\java\org\arend\typechecking\implicitargs\equations\LevelEquationsSolver.java:
41: warning: [unchecked] unchecked cast
        addEquation((LevelEquation<InferenceLevelVariable>) (LevelEquation<?>) levelEquation, false);
                                                            ^
  required: LevelEquation<InferenceLevelVariable>
  found:    LevelEquation<CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
arend\base\src\main\java\org\arend\module\serialization\DefinitionDeserialization.java:78: warnin
g: [unchecked] unchecked cast
        SerializableKey<Object> key = (SerializableKey<Object>) myKeyRegistry.getKey(entry.getKey());
                                                                                    ^
  required: SerializableKey<Object>
  found:    SerializableKey<CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
arend\base\src\main\java\org\arend\module\serialization\DefinitionSerialization.java:74: warning:
 [unchecked] unchecked cast
        SerializableKey<Object> key = (SerializableKey<Object>) entry.getKey();
                                                                            ^
  required: SerializableKey<Object>
  found:    Key<CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
arend\base\src\main\java\org\arend\typechecking\visitor\DesugarVisitor.java:261: warning: [unchec
ked] unchecked cast
        visitClassFieldImpl((Concrete.ClassFieldImpl) element, (List<Concrete.ClassFieldImpl>) elements);
                                                                                               ^
  required: List<ClassFieldImpl>
  found:    List<T>
  where T is a type-variable:
    T extends ClassElement declared in method <T>visitClassElements(List<T>,Void)
arend\base\src\main\java\org\arend\typechecking\visitor\FindDefCallVisitor.java:76: warning: [unc
hecked] unchecked cast
      myFoundDefinitions.add((T) expression.getDefinition());
                                                         ^
  required: T
  found:    @org.jetbrains.annotations.NotNull Definition
  where T is a type-variable:
    T extends Definition declared in class FindDefCallVisitor
9 warnings

> Task :cli:compileJava
arend\cli\src\main\java\org\arend\frontend\parser\BuildVisitor.java:550: warning: [unchecked] unc
hecked cast
    return returnExprCtx == null ? new Pair<>(null, null) : (Pair<Concrete.Expression,Concrete.Expression>) visit(returnExprCtx)
;
                                                                                                                 ^
  required: Pair<Expression,Expression>
  found:    Object
arend\cli\src\main\java\org\arend\frontend\parser\BuildVisitor.java:555: warning: [unchecked] unc
hecked cast
    return returnExprCtx == null ? new Pair<>(null, null) : (Pair<Concrete.Expression,Concrete.Expression>) visit(returnExprCtx)
;
                                                                                                                 ^
  required: Pair<Expression,Expression>
  found:    Object
arend\cli\src\main\java\org\arend\frontend\ui\CliSession.java:30: warning: [unchecked] unchecked
cast
      this.query = (SimpleQuery<Object>) query;
                                         ^
  required: SimpleQuery<Object>
  found:    SimpleQuery<CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
3 warnings
@ice1000
Copy link
Contributor Author

ice1000 commented Sep 24, 2020

Some are impossible to address in my opinion

ice1000 added a commit that referenced this issue Sep 24, 2020
ice1000 added a commit that referenced this issue Sep 24, 2020
ice1000 added a commit that referenced this issue Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant