src/som/interpreter/nodes/TypeCheckNode.java
protected void throwTypeError(final Object argument, final Object type,
        final Object expected, final SourceSection sourceSection,
        ExceptionSignalingNode exception) {
      CompilerDirectives.transferToInterpreter();

      // Create the exception node if it hasn't been already
      if (exception == null) {
        ExceptionSignalingNode exNode = ExceptionSignalingNode.createNode(
            Symbols.symbolFor("TypeError"), sourceSection);
        insert(exNode);
        exception = exNode;
      }

      // Get the human-readable version of the source location
      int line = sourceSection.getStartLine();
      int column = sourceSection.getStartColumn();
      String[] parts = sourceSection.getSource().getURI().getPath().split("/");
      String suffix = parts[parts.length - 1] + " [" + line + "," + column + "]";

      // Throw the exception
      exception.signal(suffix + " \"" + argument + "\" is not a subtype of "
          + sourceSection.getCharacters() + ", because it has the type: \n" + type
          + "\n    when it was expected to have type: \n" + expected);
    }
/**
     * Throw a type exception in the execution of the code.
     *
     * @param argument - the object being type checked
     * @param type - the type of the argument
     * @param expected - the expected type
     * @param sourceSection - the location at which the error occurred
     * @param exception - the exception to use to raise the error
     */
Throw a type exception in the execution of the code.
Throw a type exception in the execution of the code .
protected void throwTypeError(final Object argument, final Object type,
        final Object expected, final SourceSection sourceSection,
        ExceptionSignalingNode exception) {
      CompilerDirectives.transferToInterpreter();
      if (exception == null) {
        ExceptionSignalingNode exNode = ExceptionSignalingNode.createNode(
            Symbols.symbolFor("TypeError"), sourceSection);
        insert(exNode);
        exception = exNode;
      }
      int line = sourceSection.getStartLine();
      int column = sourceSection.getStartColumn();
      String[] parts = sourceSection.getSource().getURI().getPath().split("/");
      String suffix = parts[parts.length - 1] + " [" + line + "," + column + "]";
      exception.signal(suffix + " \"" + argument + "\" is not a subtype of "
          + sourceSection.getCharacters() + ", because it has the type: \n" + type
          + "\n    when it was expected to have type: \n" + expected);
    }
protected void throwTypeError ( final Object argument , final Object type , final Object expected , final SourceSection sourceSection , ExceptionSignalingNode exception ) { CompilerDirectives . transferToInterpreter ( ) ; if ( exception == null ) { ExceptionSignalingNode exNode = ExceptionSignalingNode . createNode ( Symbols . symbolFor ( "TypeError" ) , sourceSection ) ; insert ( exNode ) ; exception = exNode ; } int line = sourceSection . getStartLine ( ) ; int column = sourceSection . getStartColumn ( ) ; String [ ] parts = sourceSection . getSource ( ) . getURI ( ) . getPath ( ) . split ( "/" ) ; String suffix = parts [ parts . length - 1 ] + " [" + line + "," + column + "]" ; exception . signal ( suffix + " \"" + argument + "\" is not a subtype of " + sourceSection . getCharacters ( ) + ", because it has the type: \n" + type + "\n    when it was expected to have type: \n" + expected ) ; }
Throw a type exception in the execution of the code.
Throw a type exception in the execution of the code .
// Create the exception node if it hasn't been already // Get the human-readable version of the source location // Throw the exception