summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tests/concepts/tmisc_issues.nim22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/concepts/tmisc_issues.nim b/tests/concepts/tmisc_issues.nim
index fad1cd6a7..556e0b9f5 100644
--- a/tests/concepts/tmisc_issues.nim
+++ b/tests/concepts/tmisc_issues.nim
@@ -1,5 +1,8 @@
 discard """
-output: '''true'''
+output: '''true
+true
+true
+true'''
 """
 
 # https://github.com/nim-lang/Nim/issues/1147
@@ -14,3 +17,20 @@ type CAddable = concept x
 
 echo((ref TTest) is CAddable)
 
+# https://github.com/nim-lang/Nim/issues/1570
+type ConcretePointOfFloat = object
+  x, y: float
+
+type ConcretePoint[Value] = object
+  x, y: Value
+
+type AbstractPointOfFloat = generic p
+  p.x is float and p.y is float
+
+let p1 = ConcretePointOfFloat(x: 0, y: 0)
+let p2 = ConcretePoint[float](x: 0, y: 0)
+
+echo p1 is AbstractPointOfFloat      # true
+echo p2 is AbstractPointOfFloat      # true
+echo p2.x is float and p2.y is float # true
+