juan_gandhi: (VP)
[personal profile] juan_gandhi
s0.toUpperCase().contains(s1.toUpperCase)


guess what will happen

Date: 2015-03-06 07:48 am (UTC)
From: [identity profile] sassa-nf.livejournal.com
не компилируется

Date: 2015-03-06 07:53 am (UTC)
From: [identity profile] victorgr.livejournal.com
А, ну наверняка потому что .contains ожидает тип string, а получает на вход тип function?

Date: 2015-03-06 08:01 am (UTC)

Date: 2015-03-09 06:50 pm (UTC)
From: [identity profile] triampurum.livejournal.com
там второй .toUpperCase будет вызван как метод с нулем аргументов, в contains попадет строка, будет Boolean на выходе. Другими словами, в scala вызовы метод со скобочками и без скобочек в этом вот случае эквивалентны с т.з. компилятора.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

November 2025

S M T W T F S
       1
2345678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Nov. 3rd, 2025 11:31 am
Powered by Dreamwidth Studios