简体   繁体   中英

What is the “underlying type” in Scala?

Recently I have stumbled upon an scalac error message complaining about two types not being the same though the "underlying type" is the same. Regardless of the error and its specifics, I'm curious about this "underlying type". What is it ?

For a singleton type x.type it's the type of x . For example, if you have val x: Int the underlying type of x.type is Int .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM