facebook / facebook/chisel

Default argument values aren't language agnostic

未关闭
#156 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
9.2k
派生
790
PR 合并指标
30 天内没有已合并 PR

描述

Using an example to demonstrate the issue:

If `paltrace` is called while stopped in some swift code, the user would expect to be able to run `paltrace someValidSwiftExpression`. As such, `paltrace` should interpret input based on the active language at a breakpoint. However, the `paltrace` command has a default view of `(id)[[UIApplication sharedApplication] keyWindow]`, but this expression would have to be evaluated as objc.

The solution that seems to strike the right balance to me is:

> Remove the ability for commands to declare defaults in `fb.FBCommandArgument`, which would force commands to knowingly handle a default.

Other possibilities are:
1. Allow commands a way to check if an argument was provided by a default
2. Use a heuristic to recognize when a value is swift or objc
3. Use a known "keyword" for the default

The second option would be nice to have in general, and could be desirable in addition to whatever solution chosen for handling defaults.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。