Commit 424774f
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 8168df3 commit 424774f
4 files changed
Lines changed: 29 additions & 8 deletions
File tree
- de.peeeq.wurstscript
- src/main/java/de/peeeq/wurstscript
- attributes/names
- types
- validation
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
185 | 198 | | |
186 | 199 | | |
187 | 200 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
237 | | - | |
238 | 243 | | |
239 | | - | |
| 244 | + | |
| 245 | + | |
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
244 | | - | |
245 | 250 | | |
246 | 251 | | |
247 | 252 | | |
| |||
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