diff options
| author | Yong He <yonghe@outlook.com> | 2018-01-16 10:52:10 -0800 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-01-16 10:52:10 -0800 |
| commit | 59691aeeb013c5bb7cdaa31a6fc572eebd8be610 (patch) | |
| tree | 310754847c4c83ffa8fd97fcaadc7cdf7b14c253 /source/slang/diagnostics.cpp | |
| parent | 68fd4485708bf98c66e27e330692138f3eb6f289 (diff) | |
Allow extension on interface (#369)
This completes item 5 in issue #361.
The interesting change is that when checking for interface conformance, we include the requirements (include transitive interfaces) defined in extensions as well. (check.cpp line 1946)
All the other changes are for one thing: reoder the semantic checkings to two explicit stages: check header and check body. In check header phase, we check everything except function bodies, register all extensions with their target decls, then check interface conformances for all concrete types. In body checking phase, we look inside the function bodies and check concrete statements/expressions. This change ensures that we take extension into consideration in all places where it should be.
Diffstat (limited to 'source/slang/diagnostics.cpp')
| -rw-r--r-- | source/slang/diagnostics.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/diagnostics.cpp b/source/slang/diagnostics.cpp index 4f4a33e60..64713072d 100644 --- a/source/slang/diagnostics.cpp +++ b/source/slang/diagnostics.cpp @@ -62,7 +62,10 @@ void printDiagnosticArg(StringBuilder& sb, TypeExp const& type) void printDiagnosticArg(StringBuilder& sb, QualType const& type) { - sb << type.type->ToString(); + if (type.type) + sb << type.type->ToString(); + else + sb << "<null>"; } void printDiagnosticArg(StringBuilder& sb, TokenType tokenType) |
