Files
Pierre-Marie de Rodat 3888a13308 Properties: make String an opaque type
This commit switches the properties String type from Character.array to
a new opaque String type: users can only concatenate strings, which
matches the only uses of strings today. Update code emission accordingly
(mainly: move special cases for Character.array outside, for the new
String type).

TN: UA05-027
2021-10-18 11:46:46 +02:00

18 lines
665 B
Plaintext

main.py: Running...
.identity(1) = <TypeError: text string instance expected, got int instead>
.identity(b'foo') = 'foo'
.identity([b'a', b'b']) = <TypeError: text string instance expected, got list instead>
.identity('h\xe9llo') = 'h\xe9llo'
.identity(b'h\xe9llo') = <UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1: ordinal not in range(128)>
.identity([b'a', 1]) = <TypeError: text string instance expected, got list instead>
.extend('bar') = 'barfoo'
.newline() = 'hello\nworld'
main.py: Done.
main.adb: Running...
.identity("h\xe9llo") = "h\xe9llo"
.extend("h\xe9llo") = "h\xe9llofoo"
.newline() = "hello\x0aworld"
main.adb: Done.
Done