Skip to content

Commit

Permalink
Added a stub comment for implicit this warnings without any filters i…
Browse files Browse the repository at this point in the history
…n Addon.
  • Loading branch information
davidpiuva committed Mar 29, 2016
1 parent 99a0605 commit be2af46
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions source/rock/middle/Addon.ooc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import structs/[ArrayList, HashMap, MultiMap]
import ../frontend/BuildParams
import Node, Type, TypeDecl, FunctionDecl, FunctionCall, Visitor, VariableAccess, PropertyDecl, ClassDecl, CoverDecl
import tinker/[Trail, Resolver, Response, Errors]

Expand Down Expand Up @@ -155,9 +156,16 @@ Addon: class extends Node {
}

if (call suggest(fDecl, res, trail)) {
if (fDecl hasThis() && !call getExpr()) {
// add `this` if needed.
call setExpr(VariableAccess new("this", call token))
if (!call getExpr()) {
if (fDecl hasThis()) {
// add `this` if needed.
call setExpr(VariableAccess new("this", call token))
}
/* Not tested
if (res params explicitThis) {
name := fDecl hasThis() ? "this" : "This"
call token printMessage("Implicit " + name + " detected for call to " + fDecl name + "!")
}*/
}
}
)
Expand Down

0 comments on commit be2af46

Please sign in to comment.