Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refs #4412 fixed a bug in certain type errors involving complex types… #4413

Merged
merged 1 commit into from
Jan 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions doxygen/lang/900_release_notes.dox.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
- <a href="../../modules/SqlUtil/html/index.html">SqlUtil</a> module
- respect "or nothing" %Qore types when mapping to column types
(<a href="https://github.com/qorelanguage/qore/issues/4400">issue 4400</a>)
- fixed a bug in certain type errors involving complex types where the specific complex type was omitted from the
error message
(<a href="https://github.com/qorelanguage/qore/issues/4412">issue 4412</a>)
- fixed a bug initializing constant values at parse time; now all constant expressions requiring evaluation are
evaluated after all other parsing is done
(<a href="https://github.com/qorelanguage/qore/issues/4404">issue 4404</a>)
Expand Down
23 changes: 15 additions & 8 deletions include/qore/intern/QoreTypeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,8 @@ class QoreTypeInfo {
}

// static version of method, checking for null pointer
DLLLOCAL static void acceptInputParam(const QoreTypeInfo* ti, int param_num, const char* param_name, QoreValue& n, ExceptionSink* xsink) {
DLLLOCAL static void acceptInputParam(const QoreTypeInfo* ti, int param_num, const char* param_name, QoreValue& n,
ExceptionSink* xsink) {
if (hasType(ti)) {
ti->acceptInputIntern(xsink, "parameter", false, param_num, param_name, n);
} else if (ti != autoTypeInfo) {
Expand All @@ -657,7 +658,8 @@ class QoreTypeInfo {
}

// static version of method, checking for null pointer
DLLLOCAL static void acceptInputMember(const QoreTypeInfo* ti, const char* member_name, QoreValue& n, ExceptionSink* xsink) {
DLLLOCAL static void acceptInputMember(const QoreTypeInfo* ti, const char* member_name, QoreValue& n,
ExceptionSink* xsink) {
if (hasType(ti)) {
ti->acceptInputIntern(xsink, "member", true, -1, member_name, n);
} else if (ti != autoTypeInfo) {
Expand All @@ -666,7 +668,8 @@ class QoreTypeInfo {
}

// static version of method, checking for null pointer
DLLLOCAL static void acceptInputKey(const QoreTypeInfo* ti, const char* member_name, QoreValue& n, ExceptionSink* xsink) {
DLLLOCAL static void acceptInputKey(const QoreTypeInfo* ti, const char* member_name, QoreValue& n,
ExceptionSink* xsink) {
if (hasType(ti)) {
ti->acceptInputIntern(xsink, "key", false, -1, member_name, n);
} else if (ti != autoTypeInfo) {
Expand All @@ -675,7 +678,8 @@ class QoreTypeInfo {
}

// static version of method, checking for null pointer
DLLLOCAL static void acceptAssignment(const QoreTypeInfo* ti, const char* text, QoreValue& n, ExceptionSink* xsink, LValueHelper* lvhelper = nullptr) {
DLLLOCAL static void acceptAssignment(const QoreTypeInfo* ti, const char* text, QoreValue& n,
ExceptionSink* xsink, LValueHelper* lvhelper = nullptr) {
assert(text && text[0] == '<');
if (hasType(ti)) {
ti->acceptInputIntern(xsink, "lvalue", false, -1, text, n);
Expand Down Expand Up @@ -973,7 +977,8 @@ class QoreTypeInfo {
}
}

DLLLOCAL int doAcceptError(bool priv_error, const char* arg_type, bool obj, int param_num, const char* param_name, const QoreValue& n, ExceptionSink* xsink) const {
DLLLOCAL int doAcceptError(bool priv_error, const char* arg_type, bool obj, int param_num, const char* param_name,
const QoreValue& n, ExceptionSink* xsink) const {
if (priv_error) {
if (obj) {
doObjectPrivateClassException(param_name, xsink);
Expand All @@ -990,7 +995,8 @@ class QoreTypeInfo {
return -1;
}

DLLLOCAL int doTypeException(const char* arg_type, int param_num, const char* param_name, const QoreValue& n, ExceptionSink* xsink) const {
DLLLOCAL int doTypeException(const char* arg_type, int param_num, const char* param_name, const QoreValue& n,
ExceptionSink* xsink) const {
// xsink may be null in case parse exceptions have been disabled in the QoreProgram object
// for example if there was a "requires" error
if (!xsink)
Expand All @@ -1005,7 +1011,8 @@ class QoreTypeInfo {
return -1;
}

DLLLOCAL void acceptInputIntern(ExceptionSink* xsink, const char* arg_type, bool obj, int param_num, const char* param_name, QoreValue& n, LValueHelper* lvhelper = nullptr) const {
DLLLOCAL void acceptInputIntern(ExceptionSink* xsink, const char* arg_type, bool obj, int param_num,
const char* param_name, QoreValue& n, LValueHelper* lvhelper = nullptr) const {
for (auto& t : accept_vec) {
if (t.spec.acceptInput(xsink, *this, t.map, arg_type, obj, param_num, param_name, n, lvhelper)) {
return;
Expand Down Expand Up @@ -1292,7 +1299,7 @@ class QoreTypeInfo {
return;
}
if (nt != NT_OBJECT) {
str.sprintf("type '%s'", n.getTypeName());
str.sprintf("type '%s'", n.getFullTypeName());
return;
}
str.sprintf("an object of class '%s'", n.get<const QoreObject>()->getClassName());
Expand Down