Skip to content

Commit b41cb91

Browse files
authored
replace tip() with errorSupplemental() (#23729)
1 parent 7e0b115 commit b41cb91

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

compiler/src/dmd/funcsem.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,7 @@ private void printCandidates(Decl)(Loc loc, Decl declaration, bool showDeprecate
24242424
eSink.errorSupplemental(loc, "All possible candidates are marked as `deprecated` or `@disable`");
24252425
// should be only in verbose mode
24262426
if (constraintsTip)
2427-
tip(constraintsTip);
2427+
eSink.errorSupplemental(Loc.init, constraintsTip);
24282428
}
24292429

24302430
/********************************************************

compiler/src/dmd/templatesem.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,7 +3676,7 @@ const(char)* getConstraintEvalError(TemplateDeclaration td, ref const(char)* tip
36763676
buf.writestring(msg);
36773677
buf.writeByte('`');
36783678
buf.writestring(sep);
3679-
tip = "not satisfied constraints are marked with `>`";
3679+
tip = "Tip: not satisfied constraints are marked with `>`";
36803680
}
36813681
return buf.extractChars();
36823682
}
@@ -3862,18 +3862,18 @@ bool findBestMatch(TemplateInstance ti, Scope* sc, ArgumentList argumentList)
38623862
{
38633863
// Only one template, so we can give better error message
38643864
const(char)* msg = "does not match template declaration";
3865-
const(char)* tip;
38663865
OutBuffer buf;
38673866
HdrGenState hgs;
38683867
hgs.skipConstraints = true;
38693868
toCharsMaybeConstraints(tdecl, buf, hgs);
38703869
const tmsg = buf.peekChars();
3870+
const(char)* tip;
38713871
const cmsg = tdecl.getConstraintEvalError(tip);
38723872
if (cmsg)
38733873
{
38743874
eSink.error(ti.loc, "%s `%s` %s `%s`\n%s", ti.kind, ti.toPrettyChars, msg, tmsg, cmsg);
38753875
if (tip)
3876-
.tip(tip);
3876+
eSink.errorSupplemental(Loc.init, tip);
38773877
}
38783878
else
38793879
{

compiler/test/fail_compilation/fail15616b.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fail_compilation/fail15616b.d(26): `foo(T)(T a)`
2222
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
2323
` > is(T == char)
2424
` `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
25-
Tip: not satisfied constraints are marked with `>`
25+
Tip: not satisfied constraints are marked with `>`
2626
---
2727
*/
2828

0 commit comments

Comments
 (0)