third_party/closure-compiler/src/src/com/google/javascript/jscomp/TypeInference.java
/**
   * Sets the types of a named/non-destructuring function parameter to an inferred type.
   *
   * <p>This method is responsible for typing:
   *
   * <ul>
   *   <li>The scope slot
   *   <li>The param node
   * </ul>
   */
Sets the types of a named/non-destructuring function parameter to an inferred type.
This method is responsible for typing.


The scope slot
The param node

Sets the types of a named / non - destructuring function parameter to an inferred type . This method is responsible for typing . The scope slot The param node
@CheckReturnValue
  @SuppressWarnings("ReferenceEquality") 
  private FlowScope updateNamedParameter(
      Node paramName, boolean hasDefaultValue, JSType inferredType, FlowScope entryFlowScope) {
    TypedVar var = containerScope.getVar(paramName.getString());
    checkNotNull(var, "Missing var for parameter %s", paramName);
    paramName.setJSType(inferredType);
    if (var.isTypeInferred()) {
      var.setType(inferredType);
    } else if (hasDefaultValue) {
      entryFlowScope = redeclareSimpleVar(entryFlowScope, paramName, inferredType);
    }
    return entryFlowScope;
  }
@ CheckReturnValue @ SuppressWarnings ( "ReferenceEquality" ) private FlowScope updateNamedParameter ( Node paramName , boolean hasDefaultValue , JSType inferredType , FlowScope entryFlowScope ) { TypedVar var = containerScope . getVar ( paramName . getString ( ) ) ; checkNotNull ( var , "Missing var for parameter %s" , paramName ) ; paramName . setJSType ( inferredType ) ; if ( var . isTypeInferred ( ) ) { var . setType ( inferredType ) ; } else if ( hasDefaultValue ) { entryFlowScope = redeclareSimpleVar ( entryFlowScope , paramName , inferredType ) ; } return entryFlowScope ; }
Sets the types of a named/non-destructuring function parameter to an inferred type.
Sets the types of a named / non - destructuring function parameter to an inferred type .
// unknownType is a singleton // If this is a declared type with a default value, update the LinkedFlowScope slots but not // the actual TypedVar. This is similar to what would happen if the default value was moved // into an assignment in the fn body