October 23 [Issue 21917] Unused default values for IFTI parameters should not be typechecked against the IFTI-inferred type | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21917 --- Comment #9 from Max Samukha <maxsamukha@gmail.com> --- (In reply to Max Samukha from comment #8) > > What's the reason for this error: > See it now. Never mind. All seems good. -- |
October 23 [Issue 21917] Unused default values for IFTI parameters should not be typechecked against the IFTI-inferred type | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21917 --- Comment #10 from Max Samukha <maxsamukha@gmail.com> --- (In reply to Max Samukha from comment #9) > All seems good. Unfortunately, no. This compiles ok: void foo(T = int)(T a = T.init) { } void main() { foo(); foo("x"); } But if there's another template parameter, the compiler tries to reuse the previous instantiation and fails: void foo(U, T = int)(T a = T.init) { } void main() { foo!bool(0); foo!bool("x"); } Is this a bug? -- |
October 23 [Issue 21917] Unused default values for IFTI parameters should not be typechecked against the IFTI-inferred type | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21917 --- Comment #11 from Max Samukha <maxsamukha@gmail.com> --- (In reply to Max Samukha from comment #10) > void foo(U, T = int)(T a = T.init) > { > } > > void main() > { > foo!bool(0); > foo!bool("x"); > } > Error: function `foo` is not callable using argument types `(string)` -- |
October 24 [Issue 21917] Unused default values for IFTI parameters should not be typechecked against the IFTI-inferred type | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21917 Max Samukha <maxsamukha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://issues.dlang.org/sh | |ow_bug.cgi?id=24831 -- |
Copyright © 1999-2021 by the D Language Foundation