You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ChocoPy/pa2-tests/core/bad_class_member_expr.py.as...

161 lines
3.9 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 6, 10 ],
"declarations" : [ {
"kind" : "VarDef",
"location" : [ 1, 1, 1, 9 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 1, 1, 1, 5 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 1, 1, 1, 1 ],
"name" : "x"
},
"type" : {
"kind" : "ClassType",
"location" : [ 1, 3, 1, 5 ],
"className" : "int"
}
},
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 1, 9, 1, 9 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"value" : 0
}
}, {
"kind" : "VarDef",
"location" : [ 2, 1, 2, 15 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 2, 1, 2, 8 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 2, 1, 2, 1 ],
"name" : "o"
},
"type" : {
"kind" : "ClassType",
"location" : [ 2, 3, 2, 8 ],
"className" : "object"
}
},
"value" : {
"kind" : "NoneLiteral",
"location" : [ 2, 12, 2, 15 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "<None>"
}
}
} ],
"statements" : [ {
"kind" : "ExprStmt",
"location" : [ 4, 1, 4, 5 ],
"expr" : {
"kind" : "MemberExpr",
"location" : [ 4, 1, 4, 5 ],
"errorMsg" : "There is no attribute named `foo` in class `int`",
"inferredType" : {
"kind" : "ClassValueType",
"className" : "object"
},
"object" : {
"kind" : "Identifier",
"location" : [ 4, 1, 4, 1 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"name" : "x"
},
"member" : {
"kind" : "Identifier",
"location" : [ 4, 3, 4, 5 ],
"name" : "foo"
}
}
}, {
"kind" : "ExprStmt",
"location" : [ 5, 1, 5, 5 ],
"expr" : {
"kind" : "MemberExpr",
"location" : [ 5, 1, 5, 5 ],
"errorMsg" : "There is no attribute named `bar` in class `object`",
"inferredType" : {
"kind" : "ClassValueType",
"className" : "object"
},
"object" : {
"kind" : "Identifier",
"location" : [ 5, 1, 5, 1 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "object"
},
"name" : "o"
},
"member" : {
"kind" : "Identifier",
"location" : [ 5, 3, 5, 5 ],
"name" : "bar"
}
}
}, {
"kind" : "AssignStmt",
"location" : [ 6, 1, 6, 9 ],
"targets" : [ {
"kind" : "MemberExpr",
"location" : [ 6, 1, 6, 5 ],
"errorMsg" : "There is no attribute named `baz` in class `object`",
"inferredType" : {
"kind" : "ClassValueType",
"className" : "object"
},
"object" : {
"kind" : "Identifier",
"location" : [ 6, 1, 6, 1 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "object"
},
"name" : "o"
},
"member" : {
"kind" : "Identifier",
"location" : [ 6, 3, 6, 5 ],
"name" : "baz"
}
} ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 6, 9, 6, 9 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"value" : 1
}
} ],
"errors" : {
"errors" : [ {
"kind" : "CompilerError",
"location" : [ 4, 1, 4, 5 ],
"message" : "There is no attribute named `foo` in class `int`"
}, {
"kind" : "CompilerError",
"location" : [ 5, 1, 5, 5 ],
"message" : "There is no attribute named `bar` in class `object`"
}, {
"kind" : "CompilerError",
"location" : [ 6, 1, 6, 5 ],
"message" : "There is no attribute named `baz` in class `object`"
} ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}