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_attr_type.py.ast....

73 lines
1.7 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 4, 4 ],
"declarations" : [ {
"kind" : "ClassDef",
"location" : [ 1, 1, 2, 17 ],
"name" : {
"kind" : "Identifier",
"location" : [ 1, 7, 1, 7 ],
"name" : "A"
},
"superClass" : {
"kind" : "Identifier",
"location" : [ 1, 9, 1, 14 ],
"name" : "object"
},
"declarations" : [ {
"kind" : "VarDef",
"location" : [ 2, 5, 2, 16 ],
"errorMsg" : "Expected type `int`; got type `bool`",
"var" : {
"kind" : "TypedVar",
"location" : [ 2, 5, 2, 9 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 2, 5, 2, 5 ],
"name" : "x"
},
"type" : {
"kind" : "ClassType",
"location" : [ 2, 7, 2, 9 ],
"className" : "int"
}
},
"value" : {
"kind" : "BooleanLiteral",
"location" : [ 2, 13, 2, 16 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "bool"
},
"value" : true
}
} ]
} ],
"statements" : [ {
"kind" : "ExprStmt",
"location" : [ 4, 1, 4, 3 ],
"expr" : {
"kind" : "CallExpr",
"location" : [ 4, 1, 4, 3 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "A"
},
"function" : {
"kind" : "Identifier",
"location" : [ 4, 1, 4, 1 ],
"name" : "A"
},
"args" : [ ]
}
} ],
"errors" : {
"errors" : [ {
"kind" : "CompilerError",
"location" : [ 2, 5, 2, 16 ],
"message" : "Expected type `int`; got type `bool`"
} ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}