Skip to content

Commit

Permalink
Remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Jul 18, 2017
1 parent 0a56210 commit 2d82f1a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions src/style-spec/function/definitions/curve.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ class CurveExpression extends CompoundExpression {
error: `Expected at least four arguments, but found only ${compiledArgs.length}.`
}];

let firstOutputType = this.args[3].type;
if (firstOutputType.kind === 'lambda') {
firstOutputType = firstOutputType.result;
}
const firstOutputType = this.args[3].type;
let resultType;
if (firstOutputType === NumberType) {
resultType = 'number';
Expand Down
5 changes: 0 additions & 5 deletions src/style-spec/function/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ function isGeneric(type: Type, stack: Array<Type> = []) {
return true;
} else if (type.kind === 'array') {
return isGeneric(type.itemType, stack.concat(type));
} else if (type.kind === 'variant') {
return type.members.some((t) => isGeneric(t, stack.concat(type)));
} else if (type.kind === 'nargs') {
return type.types.some((t) => isGeneric(t, stack.concat(type)));
} else if (type.kind === 'lambda') {
return isGeneric(type.result) || type.params.some((t) => isGeneric(t, stack.concat(type)));
}
return false;
}
Expand All @@ -65,7 +61,6 @@ function match(
typenames: { [string]: Type } = {},
scope: 'expected' | 'actual' = 'expected'
) {
if (t.kind === 'lambda') t = t.result;
const errorMessage = `Expected ${expected.name} but found ${t.name} instead.`;

if (expected.kind === 'typename') {
Expand Down

0 comments on commit 2d82f1a

Please sign in to comment.