From 530d93723eaf25af13ef8ef9ac7a7919e81b6a1f Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sun, 14 Jun 2026 16:45:13 +0200 Subject: [PATCH] tests: update with new subscript and call checks invalid function calls now return UnknownType even if the function has a return type --- .../cases/checker/01_simple_types.py.ref.json | 17 ++- tests/cases/checker/03_functions.py.ref.json | 36 ++--- .../python-parser/02_custom_types.py.ref.json | 132 ++++++++++++++++++ 3 files changed, 157 insertions(+), 28 deletions(-) diff --git a/tests/cases/checker/01_simple_types.py.ref.json b/tests/cases/checker/01_simple_types.py.ref.json index 3c4d0b9..ac24fcd 100644 --- a/tests/cases/checker/01_simple_types.py.ref.json +++ b/tests/cases/checker/01_simple_types.py.ref.json @@ -1,4 +1,19 @@ { - "diagnostics": [], + "diagnostics": [ + { + "type": "Warning", + "location": { + "start": [ + 6, + 4 + ], + "end": [ + 13, + 5 + ] + }, + "message": "FrameType not yet supported" + } + ], "judgments": [] } \ No newline at end of file diff --git a/tests/cases/checker/03_functions.py.ref.json b/tests/cases/checker/03_functions.py.ref.json index 814bc35..fa06642 100644 --- a/tests/cases/checker/03_functions.py.ref.json +++ b/tests/cases/checker/03_functions.py.ref.json @@ -326,9 +326,7 @@ "arguments": [], "keywords": {} }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -407,9 +405,7 @@ ], "keywords": {} }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -505,9 +501,7 @@ ], "keywords": {} }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -604,9 +598,7 @@ } } }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -719,9 +711,7 @@ ], "keywords": {} }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -835,9 +825,7 @@ } } }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -916,9 +904,7 @@ } } }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -997,9 +983,7 @@ } } }, - "type": { - "name": "bool" - } + "type": {} }, { "location": { @@ -1461,9 +1445,7 @@ } } }, - "type": { - "name": "bool" - } + "type": {} } ] } \ No newline at end of file diff --git a/tests/cases/python-parser/02_custom_types.py.ref.json b/tests/cases/python-parser/02_custom_types.py.ref.json index 639610d..82c726c 100644 --- a/tests/cases/python-parser/02_custom_types.py.ref.json +++ b/tests/cases/python-parser/02_custom_types.py.ref.json @@ -18,6 +18,80 @@ ] } }, + { + "_type": "TypeAssign", + "name": "lat", + "type": { + "_type": "BaseType", + "base": "Column", + "param": { + "_type": "BaseType", + "base": "GeoLocation", + "param": null + } + } + }, + { + "_type": "AssignStmt", + "targets": [ + { + "_type": "VariableExpr", + "name": "lat" + } + ], + "value": { + "_type": "GetExpr", + "object": { + "_type": "SubscriptExpr", + "object": { + "_type": "VariableExpr", + "name": "df" + }, + "index": { + "_type": "LiteralExpr", + "value": "location" + } + }, + "name": "lat" + } + }, + { + "_type": "TypeAssign", + "name": "lon", + "type": { + "_type": "BaseType", + "base": "Column", + "param": { + "_type": "BaseType", + "base": "GeoLocation", + "param": null + } + } + }, + { + "_type": "AssignStmt", + "targets": [ + { + "_type": "VariableExpr", + "name": "lon" + } + ], + "value": { + "_type": "GetExpr", + "object": { + "_type": "SubscriptExpr", + "object": { + "_type": "VariableExpr", + "name": "df" + }, + "index": { + "_type": "LiteralExpr", + "value": "location" + } + }, + "name": "lon" + } + }, { "_type": "ExpressionStmt", "expr": { @@ -33,6 +107,64 @@ } } }, + { + "_type": "TypeAssign", + "name": "lat1", + "type": { + "_type": "BaseType", + "base": "Latitude", + "param": null + } + }, + { + "_type": "AssignStmt", + "targets": [ + { + "_type": "VariableExpr", + "name": "lat1" + } + ], + "value": { + "_type": "SubscriptExpr", + "object": { + "_type": "VariableExpr", + "name": "lat" + }, + "index": { + "_type": "LiteralExpr", + "value": 0 + } + } + }, + { + "_type": "TypeAssign", + "name": "lat2", + "type": { + "_type": "BaseType", + "base": "Latitude", + "param": null + } + }, + { + "_type": "AssignStmt", + "targets": [ + { + "_type": "VariableExpr", + "name": "lat2" + } + ], + "value": { + "_type": "SubscriptExpr", + "object": { + "_type": "VariableExpr", + "name": "lat" + }, + "index": { + "_type": "LiteralExpr", + "value": 1 + } + } + }, { "_type": "TypeAssign", "name": "lat_diff",