Open
Conversation
…ring at the end of scroll ease out
… inheritance case)
…to ExpressionParser
Problem:
- function(act){...} expressions not reaching ExpressionParser
- resolveExpressionType only checked containsOperators() or startsWith("(")
- Function expressions went through simple resolver and returned null type
Solution:
- Added looksLikeFunctionOrLambda helper (lines 4766-4773) to detect:
* JS functions: function(...)
* Arrow functions: =>
* Java lambdas: ->
- Updated gate condition at line 4144 to route these into ExpressionParser
- Function expressions now reach ExpressionTypeResolver.resolveJSFunctionType
Impact:
- SAM typing now works in pass-2 when expected type is known
- Fixes schedule("TpGainAction", function(act){...}) argument typing
- Enables proper overload resolution for function/lambda parameters
…gorithm
Problem:
- schedule("TpGainAction", function(act){...}) resolved to wrong overload
- TypeInfo.getBestMethodOverload rejected candidates when argType == null
- Fell back to arbitrary overloads.get(0) based on reflection order
- Result: selected 1-arg varargs overload instead of 2-arg fixed-arity
Solution:
- Created OverloadSelector helper class implementing scoring algorithm
- Scoring tiers (lower is better):
* Arity mismatch: +10000 + distance penalty (hard disqualifier)
* Varargs: +1000 penalty (fixed-arity strongly preferred)
* Unknown arg type (null): +10 (penalty but doesn't disqualify)
* Compatible type: +5 (modest preference for matching)
* Exact match: +0 (best case)
- Closest arity fallback when no arity-applicable overload exists
- TypeInfo.getBestMethodOverload now delegates (4 lines vs 220)
Impact:
- Deterministic overload selection (no reflection-order dependence)
- schedule("TpGainAction", function(act){...}) now resolves correctly
- Unknown arg types no longer cause fallback to unrelated overloads
- Fixed-arity methods preferred over varargs when both viable
- Removed 220 lines of complex nested logic from TypeInfo
Testing:
- OverloadResolutionTest with 6 test cases (all passing)
- Verifies fixed-arity preference, unknown arg handling, arity fallback
# Conflicts: # gradle-plugins~dev
Matches dev branch's submodule reference so branch switching works seamlessly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- add full parser/type-resolver support for Java method and constructor references - infer SAM callback types for named JS script methods with conflict reporting - surface argument-level SAM/type mismatch errors in method validation
- trigger completion after :: and detect method-reference receiver chains - restrict suggestions to methods (plus constructor refs) in method-reference mode - insert method names without parentheses when completing method references
… syntax-highlighter-unified
… syntax-highlighter-unified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.