@@ -19,6 +19,7 @@ import {
1919 StatementNode ,
2020 ContractNode ,
2121 ExpressionNode ,
22+ SliceNode ,
2223} from './ast/AST.js' ;
2324import { Symbol , SymbolType } from './ast/SymbolTable.js' ;
2425import { Location , Point } from './ast/Location.js' ;
@@ -73,7 +74,7 @@ export class InvalidSymbolTypeError extends CashScriptError {
7374 }
7475}
7576
76- export class RedefinitionError extends CashScriptError { }
77+ export class RedefinitionError extends CashScriptError { }
7778
7879export class FunctionRedefinitionError extends RedefinitionError {
7980 constructor (
@@ -160,7 +161,7 @@ export class UnequalTypeError extends TypeError {
160161
161162export class UnsupportedTypeError extends TypeError {
162163 constructor (
163- node : BinaryOpNode | UnaryOpNode | TimeOpNode | TupleIndexOpNode ,
164+ node : BinaryOpNode | UnaryOpNode | TimeOpNode | TupleIndexOpNode | SliceNode ,
164165 actual ?: Type ,
165166 expected ?: Type ,
166167 ) {
@@ -170,6 +171,8 @@ export class UnsupportedTypeError extends TypeError {
170171 } else {
171172 super ( node , actual , expected , `Tried to call member 'split' on unsupported type '${ actual } '` ) ;
172173 }
174+ } else if ( node instanceof SliceNode ) {
175+ super ( node , actual , expected , `Tried to call member 'slice' on unsupported type '${ actual } '` ) ;
173176 } else if ( node instanceof BinaryOpNode ) {
174177 super ( node , actual , expected , `Tried to apply operator '${ node . operator } ' to unsupported type '${ actual } '` ) ;
175178 } else if ( node instanceof UnaryOpNode && node . operator . startsWith ( '.' ) ) {
0 commit comments