Commit 6af0b18
fix: resolve NPE, type inference, and variable hiding issues
1. FunctionSignature.matchAgainstArgs: Remove duplicate matchAgainstSupertype
call that was added for debug logging but passed potentially-null mapping
to the second call, causing NPE on generic static method calls.
2. FuncLink.create: Only add function's own type parameters as type variables
in the mapping. Enclosing structure type params (class/module) are resolved
through receiver type matching, not through argument inference.
3. FunctionSignature.fromNameLink: Only add function definition's own type
parameters as type variables, not enclosing structure params. This prevents
module type params from appearing as unbound inference variables.
4. FuncLink.withTypeArgBinding: Also check if any type params are being bound
(even when types don't change structurally, e.g., T bound to itself within
a generic module) to ensure the FuncLink is updated.
5. WurstValidator: Downgrade variable-hides-superclass-variable from error to
warning, matching pre-wurstscript#1098 behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 91cdc24 commit 6af0b18
3 files changed
Lines changed: 6 additions & 3 deletions
File tree
- de.peeeq.wurstscript
- src/main/java/de/peeeq/wurstscript
- types
- validation
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
255 | | - | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1861 | 1861 | | |
1862 | 1862 | | |
1863 | 1863 | | |
1864 | | - | |
| 1864 | + | |
1865 | 1865 | | |
1866 | 1866 | | |
1867 | 1867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments