We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b4badd commit ed5d458Copy full SHA for ed5d458
test/Semantic/Type/Trait.fs
@@ -234,6 +234,33 @@ fn main() {
234
"add_poly", "<T0>|int, T0| -> int where int: Add<T0>" |]
235
)
236
237
+[<Fact>]
238
+let PolyReturn () =
239
+ runAnalysis
240
+ "
241
+trait Parse<T> {
242
+ fn parse(self) -> T
243
+}
244
+
245
+impl Parse<int> for int {
246
+ fn parse(self) -> int {
247
+ self
248
+ }
249
250
251
+impl Parse<bool> for int {
252
+ fn parse(self) -> bool {
253
+ self >= 0
254
255
256
257
+fn p() {
258
+ let a = 1
259
+ let b: bool = a.parse()
260
+ let c: int = a.parse()
261
+}"
262
+ |> toBe (Map [| "p", "|| -> ()" |])
263
264
[<Fact>]
265
let AddDep () =
266
runAnalysis
0 commit comments