Skip to content

Commit be2af46

Browse files
committed
Added a stub comment for implicit this warnings without any filters in Addon.
1 parent 99a0605 commit be2af46

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

source/rock/middle/Addon.ooc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import structs/[ArrayList, HashMap, MultiMap]
2+
import ../frontend/BuildParams
23
import Node, Type, TypeDecl, FunctionDecl, FunctionCall, Visitor, VariableAccess, PropertyDecl, ClassDecl, CoverDecl
34
import tinker/[Trail, Resolver, Response, Errors]
45

@@ -155,9 +156,16 @@ Addon: class extends Node {
155156
}
156157

157158
if (call suggest(fDecl, res, trail)) {
158-
if (fDecl hasThis() && !call getExpr()) {
159-
// add `this` if needed.
160-
call setExpr(VariableAccess new("this", call token))
159+
if (!call getExpr()) {
160+
if (fDecl hasThis()) {
161+
// add `this` if needed.
162+
call setExpr(VariableAccess new("this", call token))
163+
}
164+
/* Not tested
165+
if (res params explicitThis) {
166+
name := fDecl hasThis() ? "this" : "This"
167+
call token printMessage("Implicit " + name + " detected for call to " + fDecl name + "!")
168+
}*/
161169
}
162170
}
163171
)

0 commit comments

Comments
 (0)