From 59691aeeb013c5bb7cdaa31a6fc572eebd8be610 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 16 Jan 2018 10:52:10 -0800 Subject: 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. --- source/slang/diagnostics.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/slang/diagnostics.cpp') 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 << ""; } void printDiagnosticArg(StringBuilder& sb, TokenType tokenType) -- cgit v1.2.3