[
https://issues.apache.org/jira/browse/GROOVY-8965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17565130#comment-17565130
]
ASF GitHub Bot commented on GROOVY-8965:
----------------------------------------
sonatype-lift[bot] commented on code in PR #1742:
URL: https://github.com/apache/groovy/pull/1742#discussion_r918218361
##########
src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java:
##########
@@ -4702,37 +4703,36 @@ protected MethodNode findMethodOrFail(final Expression
expr, final ClassNode rec
return null;
}
- private List<MethodNode> disambiguateMethods(List<MethodNode> methods,
final ClassNode receiver, final ClassNode[] argTypes, final Expression call) {
- if (methods.size() > 1 && receiver != null && argTypes != null) {
+ private List<MethodNode> disambiguateMethods(List<MethodNode> methods,
final ClassNode receiver, final ClassNode[] arguments, final Expression call) {
Review Comment:
I've recorded this as ignored for this pull request. If you change your
mind, just comment `@sonatype-lift unignore`.
> instanceof with || inserts wrong cast
> -------------------------------------
>
> Key: GROOVY-8965
> URL: https://issues.apache.org/jira/browse/GROOVY-8965
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.5.5
> Reporter: Daniil Ovchinnikov
> Assignee: Eric Milles
> Priority: Major
>
> {code:java}
> @groovy.transform.CompileStatic
> def foo(a) {
> if (a instanceof Integer || a instanceof Double) {
> a.floatValue() // expected: cast to Number; actual: cast to Integer
> }
> }
> println foo(1d).class // CCE: java.lang.Double cannot be cast to
> java.lang.Integer
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)