Blake Anderson
10/18/2022, 5:45 AMExpression.Access.Variable
and Pattern.Variable
. Here's some debug output from my testing:
visit Variable(name=x)
> is Expression.Access.Variable: false
> is Pattern.Variable: true
Matched is Pattern.Variable
> func = function (p0) { return $boundThis.visit_ta6mxa_k$(p0); }
visit pattern variable: Variable(name=x)
visit Variable(qualifier=null, name=x)
> is Expression.Access.Variable: true
> is Pattern.Variable: false
Matched is Expression.Access.Variable
> func = function (p0) { return $boundThis.visit_ta6mxa_k$(p0); }
visit pattern variable: Variable(qualifier=null, name=x)
So, the is
check of my when
statement seems to be working fine - it's the actual function visit(ast: Expression.Access.Variable)
versus visit(ast: Pattern.Variable)
that's off (via val func: Type -> T = ::visit
). I'm guessing it's the function resolution, but could be an implementation layer. Continuing to dig around here to see what I can find out.
EDIT: Self-contained example in thread.Blake Anderson
10/18/2022, 6:03 AMvisit(obj = First.Common())
and visit(obj = Second.Common())
print visit(Second.Common), obj = ...
. I'm guessing there's probably not a workaround for this without renaming either the function names or the AST itself.
visit(Second.Common), obj = Common(name=First.Common)
visit(First.FirstUnique), obj = FirstUnique(name=First.FirstUnique)
visit(Second.Common), obj = Common(name=Second.Common)
visit(Second.SecondUnique), obj = SecondUnique(name=Second.SecondUnique)
https://gist.github.com/WillBAnders/73b128281de268aac726760d93338fbdBlake Anderson
10/18/2022, 6:42 AMBlake Anderson
10/18/2022, 10:33 PMNameTables.calculateJsFunctionSignature
, specifically this line that adds argument types to the name. I'm not sure if it.type.asString()
is supposed to include the entire package name - I'm expecting it should, but that doesn't appear to be the case.
I can't get indexing to work locally so I'm not able to track this down too well; can't tell what the type of anything is or where methods are defined. Would like to open a PR for this but not too sure where to start.Blake Anderson
10/18/2022, 10:35 PMandylamax
10/19/2022, 5:27 AM@JsName("anotherName")
Blake Anderson
10/19/2022, 6:31 AM