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/diagnostic-defs.h | |
| 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/diagnostic-defs.h')
| -rw-r--r-- | source/slang/diagnostic-defs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/slang/diagnostic-defs.h b/source/slang/diagnostic-defs.h index 24e8bc713..7227156fa 100644 --- a/source/slang/diagnostic-defs.h +++ b/source/slang/diagnostic-defs.h @@ -198,6 +198,7 @@ DIAGNOSTIC(33070, Error, expectedFunction, "expression preceding parenthesis of DIAGNOSTIC(30300, Error, assocTypeInInterfaceOnly, "'associatedtype' can only be defined in an 'interface'.") DIAGNOSTIC(30301, Error, globalGenParamInGlobalScopeOnly, "'__generic_param' can only be defined global scope.") // TODO: need to assign numbers to all these extra diagnostics... +DIAGNOSTIC(39999, Error, cyclicReference, "cyclic reference '$0'.") DIAGNOSTIC(39999, Error, expectedIntegerConstantWrongType, "expected integer constant (found: '$0')") DIAGNOSTIC(39999, Error, expectedIntegerConstantNotConstant, "expression does not evaluate to a compile-time constant") |
