mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
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
18 lines
665 B
Plaintext
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
|