Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Re-entrant implicit operator
Message
De
08/08/2016 03:42:22
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Re-entrant implicit operator
Divers
Thread ID:
01639212
Message ID:
01639212
Vues:
55
Interesting bit of bad code which the compiler does not catch and which causes stack overflow because it is re-entrant:
static void Main(string[] args)
        {
            Test test = "Hello World";
        }

    public class Test
    {
        public static implicit operator Test(string s)
        {
            return s; // obviously wrong but compiles and is re-entrant when run
        }
    }
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform