Issue 4018 - __FILE__ and __LINE__ as default template parameters not set to instantiation point per spec #2617

Merged
2 commits merged into from Oct 3, 2013

Projects

None yet

1 participant

9rnsr added some commits Oct 2, 2013
@9rnsr 9rnsr [Refactoring] Move exactly same matchArg functions up to base class 9631c69
@9rnsr 9rnsr fix Issue 4018 - __FILE__ and __LINE__ as default template parameters…
… not set to instantiation point per spec

Also fixes __MODULE__, __FUNCITON__, and __PRETTY_FUNCTION__
7c4ef33
@ghost
ghost commented Oct 2, 2013

Excellent. I like the re-done tests as well.

@ghost Unknown commented on the diff Oct 3, 2013
test/runnable/imports/testkwd_file.d
+
+/****************************************/
+
+string getFuncArgFile (string name = __FILE__ ) { return name; }
+ulong getFuncArgLine (ulong lnum = __LINE__ ) { return lnum; }
+string getFuncArgMod (string name = __MODULE__ ) { return name; }
+string getFuncArgFunc (string name = __FUNCTION__ ) { return name; }
+string getFuncArgFunc2(string name = __PRETTY_FUNCTION__) { return name; }
+
+string getFuncTiargFile (string name = __FILE__ )() { return name; }
+ulong getFuncTiargLine (ulong lnum = __LINE__ )() { return lnum; }
+string getFuncTiargMod (string name = __MODULE__ )() { return name; }
+string getFuncTiargFunc (string name = __FUNCTION__ )() { return name; }
+string getFuncTiargFunc2(string name = __PRETTY_FUNCTION__)() { return name; }
+
+template getInstTiargFile (string name = __FILE__ ) { enum getInstTiargFile = name; }
@ghost
ghost Oct 3, 2013

Should we also add a templated aggregate test (Issue 11158) or is this covered by this test already? I guess it does if struct S(T) becomes template(T) { struct S { } }.

@9rnsr
9rnsr Oct 3, 2013 Member

Not necessary. It's already covered by this test.

@ghost ghost merged commit 6c8f9ff into dlang:master Oct 3, 2013

1 check passed

default Pass: 10
Details
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment