Factory constructors are represented as static methods with dynamic
return type; in order to type infer them properly we must use the type
of the enclosing class as the return type (with type parameters
substituted appropriately).
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2900553003 .
This reverts commit d9e9382373.
There were bot failures on incremental_kernel_generator test and in
incremental_resolved_ast_test, I'm not sure yet why tests passed locally though.
BUG=
Review-Url: https://codereview.chromium.org/2894273002 .
Some details:
- Adds the tree-shaker logic and unit tests for it,
Note: I'm still not clear on what degree of tree-shaking we can get away
with. For now I have a mode to delete anything that is not seen explicitly.
This passes verification for all of our tests so far, but breaks both the
mixin and the async/await transformer in some scenarios.
- Writes a prototype of kernelForBuildUnit (although no automated tests for it
yet).
- Moves a few more pieces to ProcessedOptions
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2893493004 .
In the future we might want to re-add this, but for now, no one needs to know
that a function was async/async*/sync*. This also allows the async/await
transformer to ignore external references without any special logic.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2888823004 .
Parameters are added which point to the expressions being
inferred--this should help with debugging. Also, printing debug
statements is now enabled by uncommenting a single "with" clause
rather than uncommenting two different print statements.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2888733005 .
Previously we deferred to methods in the TypeInferrerImpl object, on
the theory that we would want to share this code with analyzer AST
type inference. But we are no longer planning to do that, so the
indirection is just cumbersome.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2890803002 .
This CL makes the following fixes:
- Updates analyzer's front_end_inference_test to represent the bottom
type as "<BottomType>" (consistent with Kernel).
- Implements type inference of "throw" expressions.
- Does not coerce bottom to dynamic when inferring the return type of
a closure.
- Does not coerce Null to dynamic when inferring the return type of a
block closure.
- Ignores bare "return;" statements when inferring the return type of
a block closure.
- Infers Null when a block closure lacks "return <expression>;"
statements.
- Implements correct rules for LUB(Null, x), by treating Null as
bottom.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2886873005 .
Previously, these classes were generic because we anticapted re-using
them with analyzer AST objects in order to do analyzer type inference.
But we've decided on a new technique for doing analyzer type
inference: infer at the kernel level and then transfer the inference
data to analyzer using the TypeInferenceListener.
So the generic parameters are no longer needed.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2885873002 .
This eliminates much of the duplication between the two token hierarchies
by merging much of the fasta.Token hierarchy into the analyzer.Token.
* merge token hierarchies
* cleanup fasta.Token.copy()
* set preceedingComments field via constructor
* replace isBuiltInIdentifier --> type.isBuiltIn
* change all fasta.Token references to analyzer.Token
* move fasta.Token.value() implementation into analyzer.SimpleToken
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2890523002 .
- Add num::== and Iterable::where to analyzer mock SDK.
- Do not default parameter types to dynamic in BodyBuilder or
KernelFormalParameterBuilder. This is now handled by the
KernelVariableDeclaration constructor.
- Only infer function expression parameter types in strong mode.
- Record inferred function expression parameter types to
instrumentation.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2886443003 .