Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21d486b commit d1ffa46Copy full SHA for d1ffa46
src/lpython/semantics/python_ast_to_asr.cpp
@@ -3313,6 +3313,17 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
3313
if (arg_name == "sep") {
3314
visit_expr(*c->m_keywords[i].m_value);
3315
separator = ASRUtils::EXPR(tmp);
3316
+ ASR::ttype_t *type = ASRUtils::expr_type(separator);
3317
+ if (!ASRUtils::is_character(*type)) {
3318
+ std::string found = ASRUtils::type_to_str(type);
3319
+ diag.add(diag::Diagnostic(
3320
+ "Separator is expected to be of string type",
3321
+ diag::Level::Error, diag::Stage::Semantic, {
3322
+ diag::Label("Expected string, found: " + found,
3323
+ {separator->base.loc})
3324
+ })
3325
+ );
3326
+ }
3327
break;
3328
}
3329
0 commit comments