Skip to content

Instantly share code, notes, and snippets.

@ufcpp
Created July 26, 2023 02:07
Show Gist options
  • Save ufcpp/f577fd443154c75d05d47ba28299b269 to your computer and use it in GitHub Desktop.
Save ufcpp/f577fd443154c75d05d47ba28299b269 to your computer and use it in GitHub Desktop.
default リテラルのオーバーロード解決?
X.M(0); // 整数リテラルの自然な型は int
X.M(default); // でも、 default は「サイズが小さい型優先」っぽい
// そういう仕様?意図的?
class X
{
public static void M(int i32) { }
public static void M(short i16) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment