I'm pretty sure expected type here should just be type, not type.getType() which always returns TypeTypeValue.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  From: lucaswojSent: Thursday, January 30, 2014 7:54 AMTo: whdl/whdlReply To: whdl/whdlSubject: Re: [whdl] Initial version of Tuple implementation. (#59)In src/main/java/org/whdl/frontend/syntaxtree/Attribute.java:
> +  
> +  public AttributeType getType() {
> +    return this.type;
> +  }
> +  
> +  public void verify() throws Exception {
> +    if(value == null) {
> +      throw new AttributeNotDefinedException(type);
> +    }
> +    value.verify();
> +
> +    TypeValue expectedType = type.getType();
> +    TypeValue actualType = value.getType();
> +    if(!actualType.isSubtypeOf(expectedType)) {
> +      throw new TypeMismatchException(expectedType, actualType);
> +    }

This code should be abstracted out into TypeValue. If it isn't already, please move it there. 

—Reply to this email directly or view it on GitHub.