-
Notifications
You must be signed in to change notification settings - Fork 330
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
Wrong details for sliding
method
#3915
Comments
After #4922, the details are `List[Int]#iterator.GroupedIterator[B]. The objective of this task now changes to inspecting why it was behaving incorrectly in the fist place and why it changed. |
IN THE OLD VERSION:The problem in created in preBody = List(
Block(
stats = List(
ValDef(
name = DerivedName(underlying = , info = NumberedInfo(num = 1)),
tpt = TypeTree[AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class collection)),trait Iterator),List(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)))],
preRhs = Select(
qualifier = Apply(
fun = TypeApply(
fun = Select(qualifier = Ident(name = List), name = apply),
args = List(
TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)]
)
),
args = List(
Typed(
expr = SeqLiteral(
elems = List(Literal(const = ( = 1))),
elemtpt = TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)]
),
tpt = TypeTree[AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class <repeated>),List(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)))]
)
)
),
name = iterator
)
)
),
expr = Typed(
expr = Block(
stats = List(
DefDef(
name = $anonfun,
paramss = List(
List(
ValDef(
name = size,
tpt = TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)],
preRhs = Thicket(trees = List())
),
ValDef(
name = step,
tpt = TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)],
preRhs = Thicket(trees = List())
)
)
),
tpt = TypeTree[AppliedType(TypeRef(TermRef(NoPrefix,val $1$),class GroupedIterator),List(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)))],
preRhs = Apply(
fun = TypeApply(
@@ head of path tree @@
fun = Select(
qualifier = Ident(
name = DerivedName(underlying = , info = NumberedInfo(num = 1))
),
name = sliding
),
args = List(
TypeTree[TypeVar(TypeParamRef(B) -> TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int))]
)
),
args = List(Ident(name = size), Ident(name = step))
)
)
),
expr = Closure(
env = List(),
meth = Ident(name = $anonfun),
tpt = Thicket(trees = List())
)
),
tpt = TypeTree[AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),trait Function2),List(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int), TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int), AppliedType(TypeRef(AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class collection)),trait Iterator),List(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int))),class GroupedIterator),List(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)))))]
)
)
) IN THE NEW VERSION (with CURSOR):
In the new version the preBody = List(
@@ head of path @@
Select(
qualifier = Select(
qualifier = Apply(
fun = TypeApply(
fun = Select(qualifier = Ident(name = List), name = apply),
args = List(
TypeTree[TypeVar(TypeParamRef(A) -> TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int))]
)
),
args = List(
Typed(
expr = SeqLiteral(
elems = List(Literal(const = ( = 1))),
elemtpt = TypeTree[TypeVar(TypeParamRef(A) -> TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int))]
),
tpt = TypeTree[AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class <repeated>),List(TypeVar(TypeParamRef(A) -> TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int))))]
)
)
),
name = iterator
),
name = slidingCURSOR
)
) I don't really understand why those trees look the way they do and how to handle such cases. |
Describe the bug
This shows up in the CompletionDocSuite:
There should ideally be no difference between the main expectation and the Scala 3 one
Expected behavior
Iterator[Int]#GroupedIterator[B]
is shown.Operating system
Linux
Editor/Extension
VS Code
Version of Metals
v0.11.5
Extra context or search terms
completions iterator sliding
The text was updated successfully, but these errors were encountered: