From 3df44722013b54790e97a32aff945708bd1b62f7 Mon Sep 17 00:00:00 2001
From: Robert Griesemer
-More precisely, for a given interface, the set ð of specific types is defined as follows: +More precisely, for a given interface, the set of specific types corresponds to +the set ð of representative types of the interface, if ð is non-empty and finite. +Otherwise, if ð is empty or infinite, the interface has no specific types. +
+ ++For a given interface, type element or type term, the set ð of representative types is defined as follows:
T
- or ~T
, ð is the set consisting of the type T
.
+ T
or a term of the form ~T
,
+ ð
is the set consisting of the type T
.
t1|t2|â¦|tn
,
- ð is the union of the specific types of the terms.
+ ð
is the union of the representative types of the terms.
-If ð is empty, the interface has no specific types. An interface may have specific types even if its type set is empty.
@@ -2021,8 +2025,10 @@ interface{ int } // int interface{ ~string } // string interface{ int|~string } // int, string interface{ Celsius|Kelvin } // Celsius, Kelvin +interface{ float64|any } // no specific types (union is all types) interface{ int; m() } // int (but type set is empty because int has no method m) -interface{ int; any } // int (any has no specific types and is ignored) +interface{ ~int; m() } // int (but type set is infinite because many integer types have a method m) +interface{ int; any } // int interface{ int; string } // no specific types (intersection is empty) -- 2.50.0