summaryrefslogtreecommitdiff
path: root/source/slang/diagnostic-defs.h
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-11-03 12:25:46 -0700
committerGitHub <noreply@github.com>2017-11-03 12:25:46 -0700
commitcc98fd4606222ec1d18878d5e8278dc32910076b (patch)
tree2a7f8ca6cef978aecfe814ea2b34bafb89c390bf /source/slang/diagnostic-defs.h
parent8fe947b2fbbdaa747fb7acc7624d9290bba52086 (diff)
Fix #248 (#249)
* Fix up test runner output for compute. We want compute-based tests to produce a `.actual` file when compilation fails, so we can easily diagnose the issue. I thought I'd added this capability previous, but it seemst to not be present any more. * Compute result types for constructor decls Fixes #246 When the parser sees an `init()` declaration, it can't easily know what type is is supposed to return, so it leaves the type as NULL. This was causing some downstream crashes. Rather than special-case every site that cares about the result type of a callable, we will instead ensure that we install an actual result type on an initializer/constructor as part of its semantic checking. This code needs to handle both the case where the initializer is declared inside a type, as well as the case where it is declared inside an `extension`.
Diffstat (limited to 'source/slang/diagnostic-defs.h')
-rw-r--r--source/slang/diagnostic-defs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/slang/diagnostic-defs.h b/source/slang/diagnostic-defs.h
index cca1c4869..cc7db7eb4 100644
--- a/source/slang/diagnostic-defs.h
+++ b/source/slang/diagnostic-defs.h
@@ -318,6 +318,7 @@ DIAGNOSTIC(38003, Error, entryPointSymbolNotAFunction, "entry point '$0' must be
DIAGNOSTIC(38100, Error, typeDoesntImplementInterfaceRequirement, "type '$0' does not provide required interface member '$1'")
DIAGNOSTIC(38101, Error, thisExpressionOutsideOfTypeDecl, "'this' expression can only be used in members of an aggregate type")
+DIAGNOSTIC(38102, Error, initializerNotInsideType, "an 'init' declaration is only allowed inside a type or 'extension' declaration")
//
// 4xxxx - IL code generation.