[groovy] do not infer closure type parameters from toString() and getParameterCount()

This commit is contained in:
Daniil Ovchinnikov
2017-04-21 18:28:42 +03:00
parent ba5e5fa4cf
commit af01bdcff6
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,6 +67,12 @@ public class GrClosureType extends GrLiteralClassType {
return "Closure";
}
@Override
public int getParameterCount() {
PsiClass resolved = resolve();
return resolved != null && resolved.getTypeParameters().length == 1 ? 1 : 0;
}
@Override
@NotNull
public PsiType[] getParameters() {
@@ -188,4 +194,9 @@ public class GrClosureType extends GrLiteralClassType {
public GrSignature getSignature() {
return mySignature;
}
@Override
public String toString() {
return "PsiType: Closure<*>";
}
}