High Sierra: Can't merge BOOTCAMP partition with APFS container
First convert the former Boot Camp partition to free space:

sudo diskutil eraseVolume "Free Space" %noformat% /dev/disk0s3


Then expand your APFS container to the max (0 is a magic size here):

diskutil apfs resizeContainer disk0s2 0