I tried this out, and it works for some cases but not for others. I'm doing something similar to:
```
compilationUnit.withSourceFile(... => { compiler.askOption(() => {
  val p = new RangePosition(srcFile, offset, offset, offset + length -1) //also tried no -1
  val context = compiler.doLocateContext(p)
  val tree = compiler.locateTree(p)
  logger.error("tree is " + tree)
  val typer = compiler.analyzer.newTyper(context)
  val ttree = typer.typed(tree)
  logger.error("ttree is " + ttree)
}})
```
(offset is the beginning of each argument, and length is the length of it)

The file I'm testing looks like this:
```
val str = "asdf"
other.unknownMethod(str.length, "a" * str.length)
```

I end up with:
```
tree is str.length{<null>}
ttree is ScopeCheck.this{ScopeCheck.this.type}.str.length{()Int}(){Int}
tree is "a"{<null>}.$times{<null>}(str.length{<null>}){<null>}
ttree is "a"{String("a")}.<$times: error>{<error>}(str.length{<null>}){<error>}
```

So it works on ```str.length``` but not ```"a" * str.length```. A couple others that I tested which it does work for: ```str.length * 2```, ```str.length.toString```