From 11f44241ffef478560eaba79af330c16f0bc8d69 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 30 Oct 2017 10:03:52 -0700 Subject: Allow for implicit `this` expressions. - When peforming ordinary lookup, if the container declaration for a scope is an aggregate type or `extension` decl, then use a "breadcrumb" to make sure that we use a `this` expression as the base of any resulting declaration reference - Add a test case for implicit `this` usage - Update constrained generic test case to use implicit `this` for member reference, as was originally intended --- source/slang/syntax.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/syntax.h') diff --git a/source/slang/syntax.h b/source/slang/syntax.h index d32c4de15..0b5a38631 100644 --- a/source/slang/syntax.h +++ b/source/slang/syntax.h @@ -859,6 +859,12 @@ namespace Slang // lookup was able to find a member through type `U` // instead. Constraint, + + // The lookup process considered a member of an + // enclosing type as being in scope, so that any + // reference to that member needs to use a `this` + // expression as appropriate. + This, }; // The kind of lookup step that was performed -- cgit v1.2.3