update n-body for comparison

This commit is contained in:
dcode
2019-03-19 10:09:06 +01:00
parent 7693b543f4
commit d42ef51cf0
6 changed files with 1198 additions and 1085 deletions

View File

@ -82,6 +82,10 @@ import {
Token
} from "./tokenizer";
import {
BuiltinSymbols
} from "./builtins";
/** Indicates whether errors are reported or not. */
export enum ReportMode {
/** Report errors. */
@ -1208,6 +1212,14 @@ export class Resolver extends DiagnosticEmitter {
);
if (!target) return null;
if (target.kind == ElementKind.FUNCTION_PROTOTYPE) {
// `unchecked(expr: *): *` is special
if (
(<FunctionPrototype>target).internalName == BuiltinSymbols.unchecked &&
expression.arguments.length > 0
) {
return this.resolveExpression(expression.arguments[0], flow, contextualType, reportMode);
}
// otherwise resolve normally
let instance = this.resolveFunctionInclTypeArguments(
<FunctionPrototype>target,
expression.typeArguments,